Method and system of self-calibration for phase detection autofocus

ABSTRACT

Techniques related to self-calibration for phase detection autofocus.

BACKGROUND

In digital cameras, autofocus may be used to focus on an object ofinterest. Such digital cameras may be provided as stand alone devices orthey may be integrated into a multipurpose device such as a smartphoneor the like. In various implementations, digital cameras may use phasedetection autofocus (PDAF also referred to as phase autofocus or phasebased autofocus), contrast based autofocus, or both. Phase detectionautofocus separates left and right light rays though the camera's lensto sense left and right images. The left and right images are compared,and the difference in image positions on the camera sensors can be usedto determine a shift of a camera lens for autofocus. Contrast autofocusmeasures the luminance contrast over a number of lens positions until amaximum contrast is reached. A difference in intensity between adjacentpixels of the camera's sensor naturally increases with correct imagefocus so that a maximum contrast indicates the correct focus. Phasedetection autofocus may be advantageous in some implementations becauseit is typically faster than contrast based autofocus. For example, phasedetection autofocus may allow a digital camera to determine the correctdirection and amount of lens position movement based on a single frameof captured information, which may increase focusing speed. Furthermore,phase autofocus may be advantageous because it limits or eliminatesovershoot (e.g., the camera changing lens position past the position offocus to obtain the information needed to determine the position offocus as performed in contrast based autofocus). Such overshoots taketime and can reduce quality in video capture.

Calibration steps are conventionally required at the production line inorder to handle variations between camera module samples during massproduction to achieve sufficient autofocus accuracy with all samples.This includes detecting phase shifts between pairs of left and rightsensor pixels. The phase shifts are then used to determine spatialcharacterization or conversion values to convert the phase shifts tolens offsets which are the distances a lens must move to correct for ameasured phase shift and bring an object in a scene to be captured intofocus. Phase detection autofocus calibration also may include acharacterization of spatial shading of the left and right sensor pixelsso that corrections in shading can be computed later during a run-timeto capture images.

During calibration of phase shift mapping into lens offset, the mappingis set independently for each camera or sample to attain sufficientaccuracy. Likewise, a flat field image is captured per sample, andcorrection gains are calculated for left and right type pixel valuesindependently for each sample. Use of such PDAF calibration at theproduction line, however, where each sample is handled separatelyresults in significant delay and costs. Also, inaccuracies and/ormistakes can occur when the per sample calibration data is captured andstored. Thus, the PDAF production line calibration actually may add anerror source that is difficult and costly to debug.

BRIEF DESCRIPTION OF THE DRAWINGS

The material described herein is illustrated by way of example and notby way of limitation in the accompanying figures. For simplicity andclarity of illustration, elements illustrated in the figures are notnecessarily drawn to scale. For example, the dimensions of some elementsmay be exaggerated relative to other elements for clarity. Further,where considered appropriate, reference labels have been repeated amongthe figures to indicate corresponding or analogous elements. In thefigures:

FIG. 1 is a schematic diagram of an example image capture device toperform the self-calibration phase detection autofocus implementationsherein;

FIGS. 2A-2C are simplified schematic diagrams of an image capture devicewith a lens at different positions to assist with explaining phasedetection autofocus;

FIG. 3 is a schematic close-up view of sensor pixels on an example imagecapture device that can be used to perform the self-calibration phasedetection autofocus implementations herein;

FIG. 4 is a schematic elevational diagram of an image sensor with apixel layout and of the image capture device of FIG. 3;

FIG. 5 is a schematic elevational close-up view of sensor pixels onanother example image capture device that can be used to perform theself-calibration phase detection autofocus implementations herein;

FIG. 6 is a schematic diagram of an image sensor with a pixel layout andof the image capture device of FIG. 5;

FIG. 7 is a schematic diagram of an imaging device usingself-calibration for phase detection autofocus

FIG. 8 is an illustrative diagram of an example grid of regions ofinterests used for image data statistics to be used to perform theself-calibration phase detection autofocus implementations herein;

FIG. 9 is a flow chart illustrating an example method ofself-calibration for phase detection autofocus;

FIGS. 10A-10C is a flow chart illustrating an example detailed method ofself-calibration for phase detection autofocus;

FIG. 10D is a graph of mapping of phase shift to lens offset to assistwith explaining PDAF self-calibration according to the implementationsdescribed herein.

FIGS. 11A-11B is a flow chart illustrating another example detailedmethod of self-calibration for phase detection autofocus;

FIG. 12 is an illustrative diagram of an example system for providingself-calibration for phase detection autofocus;

FIG. 13 is an illustrative diagram of an example system; and

FIG. 14 illustrates an example device, all arranged in accordance withat least some implementations of the present disclosure.

DETAILED DESCRIPTION

One or more implementations are now described with reference to theenclosed figures. While specific configurations and arrangements arediscussed, it should be understood that this is performed forillustrative purposes only. Persons skilled in the relevant art willrecognize that other configurations and arrangements may be employedwithout departing from the spirit and scope of the description. It willbe apparent to those skilled in the relevant art that techniques and/orarrangements described herein also may be employed in a variety of othersystems and applications other than what is described herein.

While the following description sets forth various implementations thatmay be manifested in architectures such as system-on-a-chip (SoC)architectures for example, implementation of the techniques and/orarrangements described herein are not restricted to particulararchitectures and/or computing systems and may be implemented by anyarchitecture and/or computing system for similar purposes. For instance,various architectures employing, for example, multiple integratedcircuit (IC) chips and/or packages, and/or various computing devicesand/or consumer electronic (CE) devices such as image capture devices,digital cameras, smart phones, webcams, video game panels or consoles,set top boxes, tablets or laptops with one or more autofocus cameras,and so forth, may implement the techniques and/or arrangements describedherein. Further, while the following description may set forth numerousspecific details such as logic implementations, types andinterrelationships of system components, logic partitioning/integrationchoices, and so forth, claimed subject matter may be practiced withoutsuch specific details. In other instances, some material such as, forexample, control structures and full software instruction sequences, maynot be shown in detail in order not to obscure the material disclosedherein. The material disclosed herein may be implemented in hardware,firmware, software, or any combination thereof.

The material disclosed herein may also be implemented as instructionsstored on a machine-readable medium or memory, which may be read andexecuted by one or more processors. A machine-readable medium mayinclude any medium and/or mechanism for storing or transmittinginformation in a form readable by a machine (for example, a computingdevice). For example, a machine-readable medium may include read-onlymemory (ROM); random access memory (RAM); magnetic disk storage media;optical storage media; flash memory devices; electrical, optical,acoustical or other forms of propagated signals (e.g., carrier waves,infrared signals, digital signals, and so forth), and others. In anotherform, a non-transitory article, such as a non-transitory computerreadable medium, may be used with any of the examples mentioned above orother examples except that it does not include a transitory signal perse. It does include those elements other than a signal per se that mayhold data temporarily in a “transitory” fashion such as RAM and soforth.

References in the specification to “one implementation”, “animplementation”, “an example implementation”, and so forth, indicatethat the implementation described may include a particular feature,structure, or characteristic, but every implementation may notnecessarily include the particular feature, structure, orcharacteristic. Moreover, such phrases are not necessarily referring tothe same implementation. Further, when a particular feature, structure,or characteristic is described in connection with an implementation, itis submitted that it is within the knowledge of one skilled in the artto affect such feature, structure, or characteristic in connection withother implementations whether or not explicitly described herein.

Methods, devices, systems, and articles are described herein related toproviding self-calibration for phase detection autofocus.

As described above, digital cameras (e.g., cameras or cameras integratedwithin devices such as smartphones or the like) may perform autofocus(AF) using phase detection autofocus (PDAF) or contrast based autofocusor both. Some hybrid systems include PDAF or both of these two autofocusmethods in addition to other AF methods such as those AF methods thatuse time-of-flight based distance measurement components, ormulti-camera stereo imaging based distance measurements. In someinstances, a digital camera may use phase detection autofocus, which isadvantageously faster and can eliminate overshoot. However, calibrationfor phase detection autofocus so far has required capturing and storingcalibration data at a production line.

Particularly, a camera sensor may be divided into blocks or regions ofinterest (ROIs) of sensor pixels. The PDAF data is obtained either byusing a PDAF metal shield (MS) system or a PDAF dual photodiode (DP)system, or some other way of separating light rays from opposite sidesof an aperture. In a PDAF-MS system, a metal shield is placed above asingle sensor pixel to divide the light beams hitting the sensor toobtain either a right image or a left image. These sensor pixels areprovided in pairs to obtain both a right image on one sensor pixel and aleft image on another sensor pixel. In a PDAF-DP system, two sensorphotodiodes are provided under a single microlens to separately receivea right image and a left image. More details are provided below.Relevant here, the data from each ROI is used to determine PDAFcalibration data. Also, each camera is conventionally tested at Mcalibration target distances and N lens positions for each targetdistance needed to be captured, and for each ROI at the production line.The mappings from phase shifts (the difference of image location betweenthe right and left pixels) into lens offsets are determined for eachcamera and each ROI therein. That is, the phase shifts may be used tomap (or provide a conversion) from the phase shift to lens offset. Oneor more of these ROI conversions are selected to move a single lens by alens offset to then capture an image. These conversions, however, varyfrom one camera (or sample or module) to another.

Also, since shading is different from sample to sample, the shading ofleft and right pixels of an ROI is conventionally calibrated for asingle camera by capturing a flat field image in a carefully controlledlight environment for each sample. A flat field image is captured persample, which enables sample specific spatial shading corrections of theleft and right pixel signals. The shading values then may be stored in acamera or sample electrically erasable programmable read-only memory(EEPROM) or device file system, and this shading information may be usedduring run-time to correct the shading for a number of applications. Theleft and right shading values per ROI are kept in PDAF-statistics toreduce the shading difference between left and right type signals beforecalculation of similarity metrics (or difference metrics such asSum-of-Absolute-Differences (SAD) for some processors) during run-time.In other words, the shading difference is determined to eliminate theshading difference from the left and right image differences (ordifference metrics) so that it is clear which part of that difference isattributable to the phase shift and which part to the shadingdifference.

The labor and equipment to set up the phase shift mapping and shadingcalibration to obtain the precise mapping and shading measurements aswell as to setup a specified light environment at the production linecan be very time consuming and costly. Also, when the measurements arenot performed correctly according to specifications for all camerasamples, and/or the illumination and/or test chart setup change overtime in such a way that the measurement results are changed, theproduction line calibration can insert another error source that isdifficult and costly to debug. Certain personnel may need to come to acertain manufacturing facility, and/or the error may be difficult orexpensive to detect as well as time consuming by inspection or expensivetesting. Putting in place and running a process for a consumer to returncameras to repair this error compounds the expense even further.

The systems and methods disclosed herein may trackphase-shift-to-lens-offset mapping errors over a number of iterationsduring the early operation of an image capture device. The error can bedetermined based on a prediction error that is a difference between thepredicted in-focus lens position of a previous iteration that is used toposition the lens, and the true in-focus lens position that is knownafter completing all of the auto focusing iterations. This predictionerror can be determined from all the iterations that preceded the truein-focus lens position. When significant prediction errors exist, theerror values may vary widely from iteration to iteration. The predictionerror can result from erroneous phase-shift-to-lens-offset mapping, orit can result from some other reason, such as moving target object orpoor signal to noise ratio in the PDAF signal. If the prediction errorsacross multiple autofocus iterations and multiple focusing rounds areconsistent with certain change in the phase-shift-to-lens-offsetmapping, then it is likely that the mapping does not fit well with thecamera sample and should be updated. On the other hand, if theprediction errors are not consistent, then they are likely resultingfrom other error sources and not related to the mapping. It will beappreciated that herein phase shift and disparity are usedinterchangeably to refer to the difference value between a pair of leftand right sensor pixels (or dual pixels or photodiodes of the PDAF-DPsystem).

To reduce or eliminate the need for sample-specific PDAF calibration atthe production line, local mappings from ROI disparities to lens offsetsmay be updated and that is based on the distance from the actual lensposition at individual iterations established using the earlier (golden)mapping to an optimal focus lens position. The lens offset to attain theoptimal focus lens position at each iteration is the lens offset thatshould have occurred at each iteration. Once the correct lens offset isdetermined at each iteration, a new local conversion factor from phaseshift (or disparity) to lens offset can be determined. When these localconversion values are the same or close to the same from iteration toiteration for a certain number of iterations, and the conversion valueis not the one that is already stored for this camera sample (initiallythis is the conversion value for a “golden” reference camera thatrepresents an average camera) and ROI, then this indicates that theconversion value for this camera and ROI needs to be updated. Once nosuch consistent need for conversion value change is detected formultiple iterations, then the self-calibration is considered complete. Asingle set of iterations, which may be referred to as a focusing round(or just round), still may not be sufficient. Thus, by one form, anumber of rounds of iterations are tested where each round is a completefocus operation upon an object in a scene to be captured in an image.Once calibration is consistent for a number of rounds, the adjusted (orrefined or replacement) conversion, or a look-up table of values usingthe conversion in a conversion function, is then stored for subsequentcapture of images by an end user and the self-calibration is complete.The self-calibration operations may be performed when first using animage capture device (also referred to as an imaging device herein), butcould otherwise be performed each or individual times the image capturedevice is turned on.

As to the shading statistics, the present methods calculate local ROIshading estimates for left and right images by using the shading fromregular (non-PDAF) image data in addition to the left and right shadingdata from the PDAF sensors. The resulting shading data is stored forrun-time PDAF calculations. The shading estimate may be accumulated andupdated from a few frames in the early use of the device, and byaveraging left or right shading values over the average of regular pixelshading values in individual ROIs, and average over all frames up to acurrent frame. Once sufficient shading estimates are established, thestored data does not need further updating. Consequently, in thebeginning of a sequence of images such as for video recording andplayback, the PDAF accuracy would be about the same as existing systemsthat do not support compensating for the effect of left versus rightshading differences, and thereafter, the accuracy would improveimmediately when the camera is capturing image content that is suitablefor self-calibration.

One of the initial operations for both phase-shift conversioncalibration and shading calibration is to use an average, ideal cameraor sample such as a golden sample (also referred to as a golden moduleor golden module sample) based characterization, so the system can befully functional as soon as it is used. By some alternatives, PDAF iscombined with contrast AF to produce a hybrid AF (which may even includeother autofocus techniques in addition to contrast), so that contrast AFmay correct for the residual errors that remain after PDAF. Certainrepetitive textures and low illumination level, for example, inherentlyrequire a fallback operation that uses contrast AF when the PDAF fails,or is not attempted at all, especially in the cases when metal shieldbased PDAF has a worse SNR than with other autofocus techniques. Thismay be reserved for the lower cost devices that are using PDAF. Otherdetails are provided below.

FIG. 1 is an illustrative diagram of an example imaging device 100 forproviding autofocus and performing PDAF self-calibration, arranged inaccordance with at least some implementations of the present disclosure.As shown in FIG. 1, in an embodiment, imaging device 100 is asmartphone. As shown, imaging device 100 may include a front 101 and aback 102. In some examples, as shown, the back 102 of imaging device 100may include an integrated camera 103 (e.g., including a lens, anaperture, and an imaging sensor) and a flash 104 (e.g., a flash or flashlight such as a supercapacitor LED or the like). Also as shown, thefront 101 of imaging device 100 may include a speaker 106, a display107, and one or more buttons 108. Furthermore, imaging device 100 mayinclude a microphone 105, which in the illustrated example is shown onthe bottom of imaging device 100. Such devices may provide for a varietyof uses of imaging device 100.

The described components of imaging device 100 may be incorporated inany suitable manner. For example, camera 103 and flash 104 may beincorporated on the front 101 of imaging device 100. In some examples,both a front and back camera and flash may be incorporated into imagingdevice 100. Furthermore, in some examples, display 107 may be a touchscreen display such that a user may interact with imaging device 100 viacommands initiated via display 107 such as tapping display 107 toindicate an object or region of interest for focusing. As discussed, insome examples, imaging device 100 may include each of the describedcomponents. In other examples, imaging device 100 may not include one ormore of the described components. For example, imaging device 100 maynot include speaker 106, display 107, and/or microphone 105.Furthermore, the discussed components may be incorporated into any formfactor device such as the illustrated smartphone, a dedicated camera, anultrabook, a laptop, a tablet, or any other device that has an autofocuscamera. For example, dedicated cameras may include point and shootcameras, interchangeable lens system cameras, mirror-less cameras,digital single-lens reflex (DSLR) cameras, and so on.

As discussed, camera 103 may include an image sensor. The image sensormay capture image data and phase autofocus data as discussed herein.

Referring to FIGS. 2A-2C, autofocus involves automatically moving a lenscloser or farther from a light sensor so that the far left and far rightlight rays reflecting from the object and through a lens hit at the samepoint (the focal point) on the sensor. To illustrate, an image capturedevice 200 is placed facing an object 202 that may be focused on by alens 204 shown here in three different lens positions d1, d2, and d3,indicated as distances from a sensor 206. Furthermore, as shown, lightrays 208 and 210 may reflect from object 202 and pass through lens oroptics 204. The light may be divided into right and left sides by anaperture that is not shown here but is discussed below, and then ontosensor 206. As shown, the lens 204 is too close to the object 202 (tooforward) in FIG. 2A causing the left and right light rays 208 and 210 tocross above the sensor 206 or in front of the sensor (referred to as afront focus), and so that the order from left to right of the light raysintersecting the sensor 206 is switched from a back focus (FIG. 2C)where the left ray 208 intersects the sensor 206 to the left of theright ray 210. The back focus has the lens 204 too far from the object202 (too backward) so that the focal point is behind the sensor 206.FIG. 2B shows the correctly focused arrangement so that the left andright rays 208 and 210 intersect at the sensor 206.

Actually, the sensor 206 will sense a spectrum of intensity that can begraphed into an intensity profile with the most intense part at thecenter of the left or right light ray. If intensity profiles fromseparately recorded light rays are aligned or nearly aligned (where thepeak of the profile is at the same location on the sensor), object 202is in focus. In some examples, whether intensity profiles are alignedmay be determined based on evaluating differences pixel pair by pixelpair inside a 2D area of sensor 200. The difference 214 or 216 betweenlocations where the light rays, of intensity peaks, hit on the sensor isthe phase shift needed to be converted into lens motion (in thedirection perpendicular to the sensor) or lens offset to obtain properfocus. Depending on whether the light rays cross, a direction of lensposition movement may be determined. Thereby, based on the distance 214or 216 between the light rays at the sensor (or peaks of intensityprofiles) and their orientations with respect to each other (e.g., whichone is on the left), an autofocus phase shift and direction may bedetermined for imaging device 100. In some examples, the autofocus phaseshift may be characterized as a phase difference or phase differenceinformation. For example, the autofocus phase shift or phase differencemay be an amount of shift (e.g., in pixels, with sub-pixel accuracy)that is needed to eliminate the difference between the left phaseautofocus (PAF) and the right-PAF pixels. It will be understood thatwhile left and right are used herein for convenience, the pixels couldbe one above the other or in a diagonal arrangement as described below.Also, it will be understood that the PDAF lens offset to compensate fora phase shift is a correction that will move the lens from out-of-focusposition into in-focus position.

Referring to FIGS. 3-4, an example image capture device 300 has a sensor310 formed of sensor pixels 402 each to sense one color in a Bayerfilter pattern for example blue B, red R, and greens Gr and Gb setdiagonally in the Bayer quad. In this example, image capture device 300uses a metal shield (MS) to divide reflected light into left and rightlight rays. Such an MS or PDAF-MS sensor 310 has spaced pairs 312 ofphase autofocus detection (PDAF) sensor pixels 308 and 314 for example,interspersed among regular image (non-PDAF) sensor pixels 402. Forexample, sensor 310 may include any number of image sensor pixels 402such as 8 megapixels, 10 megapixels, 12 megapixels, or the like and anydesired number of pairs 312 of PDAF sensor pixels such as, for example,300,000 pairs, 400,000 pairs, or 500,000 pairs 312 or the like. Forexample, pairs 312 of PDAF sensor pixels 308 or 314 may have a densitysufficient to provide a desired resolution. Regular image (non-PDAF)sensor pixels 402 and pairs 312 of PDAF sensor pixels may include anysuitable photo sensors such as charge-coupled devices, active sensorpixels, photodiodes, or any other devices that convert light into anelectrical signal. It should be noted that the regular image sensorpixels 402 as well as the PDAF sensor pixels 308 and 314 for examplealso may be referred to as sensor pixels, or just pixels or just sensorsdepending on the context.

Furthermore, the pairs 312 of PDAF sensor pixels in a PDAF-MS system maybe arranged on the sensor 310 in any suitable manner such that they mayattain two phase autofocus images as discussed herein. For example, asshown on sensor 310, pairs 312 of PDAF sensor pixels may be arrangeddiagonally and adjacent to one another as shown with respect to PDAFsensor pixel 308 and PDAF sensor pixel 314. In other examples, PDAFsensor pixels 308 and 314 may be arranged horizontally and adjacent toone another or vertically and adjacent to one another. In theillustrated example, PDAF sensor pixels 308 and 314 are shownsubstantially next to each other. In other examples, PDAF sensor pixels308 and 314 may be separated by a distance such that they are not nextto each other and such that one or more regular image sensor pixels 402are between them. Pairs 312 of PDAF sensor pixels may be arranged in anymanner on sensor 310 such as spaced uniformly as shown on sensor 310, orin a varying pattern. Furthermore, pairs 312 of PDAF sensor pixels maybe separated or spaced from each other by an offset.

Pairs 312 of PDAF sensor pixels 308 and 314 may record light raysseparately such that one sensor pixel 308 of the pair may record lightrays entering from a left side of an aperture and the other sensor pixel314 of the pair may record light rays entering from a right side of theaperture. For instance, image capture device 300 is shown with a pixelstructure 302 and 318 that respectively provide the pair 312 of PDAFsensor pixels 308 and 314 of sensor 310. Each pixel structure 302 and318 has its own microlens or optical member 304 and 320 respectivelyabove a color filter array (CFA) 306 or 322 respectively. Themicrolenses 304 and 320 are disposed near the sensor layer under themain moving lens (such as the lens 204 (FIG. 2)). The microlenses 304and 320 above each pixel do not move and are positioned to direct lightat a more perpendicular angle to the sensor 308 and 314 when light raysare received at a severe angle relative to the sensor plane. The colorfilter array 306 and 322 may divide color light rays according a desiredpattern, such as the Bayer filter quad pattern. A metal shield 316 isplaced between the sensor pixels 308 and 314 on one side of the metalshield and the lens 304 and 320 as well as the filters 306 and 322 onthe other side of the metal shield. An aperture in the metal shield isformed by a left aperture edge 328 and a right aperture edge to extendover only an opposite portion of each sensor pixel 308 and 314. In otherwords, the metal shield 316 extends over the left side of the sensorpixel 308 and the right side of the sensor pixel 314.

With this configuration, the metal shield blocks the light rays (shownin dashed lines) from reaching the left side of the sensor 308, whilepermitting sensor pixel 308 to receive light rays (without dashes)through the aperture and past left edge 328 and to the right side of thesensor pixel 308. The opposite is true of the sensor pixel 314 where themetal shield only permits light rays to reach the left side of thesensor pixel 314. The sensor pixel 308 receiving light rays on its rightside is considered the right sensor pixel, while the sensor pixel 314receiving light rays on its left side is considered the left sensorpixel. Thus, it should be noted that the pair 312 of sensor pixels shownon sensor 310 are identified as R or L depending on whether the right orleft side of the sensor pixel receives light to respectively provideimage data of a left or right image, and does not necessarily coincidewith a right or left location on the sensor 310 itself. Furthermore, useof the terms left and right herein are provided for clarity ofpresentation only. For example, the light rays may be oriented left andright as described or top and bottom or any other orientation that mayprovide for the separate images needed for phase autofocus.

Referring to FIGS. 5-6, an alternative PDAF dual photodiode (PD) system500 has two adjacent photodiodes in the sensor area previously reservedfor a single sensor pixel. As shown, an image capture device may have asensor pixel structure with a microlens 504 and color filter array 506as described above with imaging device 300, but that extends over asensor pixel 508 formed of a pair of separate photodiodes including aright DP-sensor 510 and a left DP-sensor 512 which respectively receiveleft and right light rays to form left and right images. The sensorpixel 508 is merely one pixel of many on a sensor 600 shown here withBayer quad pixels as well. In this case, however, each sensor pixel 508is divided into two separate photodiodes 510 and 512 where each leftDP-sensor forms a left image and each right DP-sensor forms a rightimage. These right and left DP sensors each may be referred to as asensor pixel herein where the difference between the DP and MS systemsare not relevant, and either system is being referred to.

As mentioned, the right and left PDAF sensor pixels of sensor 310 (or600) may record the image data of the right and left light rays (after achange in lens position or the like) separately to generate intensityprofiles, respectively. Although illustrated as a one-dimensional (1D)signals, intensity profiles may be two-dimensional (2D) signals providedover an area of sensor 310 (or 600). The separate recording of left andright light rays may provide for two phase autofocus images (e.g., aleft image and a right image). For example, the left and right imagesmay be based on a same image frame and/or image. In some examples, leftand right images may be attained via PDAF sensor pixels 308 and 314 ofsensor 310, or DP-sensors 510 and 512 of sensor 600. In some examples,no separate and full left and right images or image planes may beavailable, and instead a pixel stream from sensor 310 or 600 may beprocessed on-the-fly and may have only one or two lines of a frame at atime instead of the entire frame. Similarly, left and right images asdescribed herein may include a stream of data associated with the leftand right images (e.g. without full images being fully available at anytime). As used herein, the term image includes fully formed images orimage planes or partially formed images or image planes or datarepresenting such fully or partially formed images or image planes. Animage may be referred to herein as a picture or frame each associatedwith a different iteration depending on the context. Furthermore, as isdiscussed further herein, phase detection autofocus may be provided byshifting those images with respect to one another (e.g., horizontally asdiscussed herein or vertically) to determine a focus phase shift.

Referring to FIG. 7, an example imaging device 700 is provided toimplement the PDAF self-calibration methods described herein, and may beimaging device 100. Otherwise other than smartphones, imaging device 700may be any image capture device that uses phase detection autofocuswhether a stand-alone digital or digital single lens reflex (DSLR)autofocus cameras or digital still cameras (DSCs), web cams, and soforth, or device 700 may be, or may be on, a device with one or moreautofocus cameras such as tablets, computers, video game box devices,and others. The components of the imaging device 700 shown may be, invarious examples, implemented via one or more central processingunit(s), image processing units, and/or graphics processing unit(s) asis discussed further herein.

Device 700 may include image processing and autofocus (AF) module 706that may obtain phase autofocus (PAF) sensor data from PAF sensors 702.For example, PAF sensor data may be provided via pairs of PDAF sensorpixels 312 or 508 of sensor 300 or 600 respectively, or as discussedherein. When the PAF sensors 702 are from a PDAF-MS system that has PDAFpairs spaced throughout a sensor, then regular image sensors 704 alsomay provide raw intensity and chroma image data separately from the PDAFsensor pixels (PAF sensors 702). Otherwise, in PDAF-DP system the PAFsensors provide all image data with the dual photodiodes per pixel asalready described above.

PAF sensor data may include any suitable data such as an electricalsignal indicating at least sensor intensities or the like. In someexamples, PAF sensor data may be temporarily stored in a memory ofimaging device 700. Image processing and autofocus module 706 mayreceive PAF sensor data from PAF sensors 702 or memory and may generatephase autofocus (PAF) images or portions of phase autofocus images inreal-time and on-the-fly as discussed herein. For example, PAF imagesmay include a first PAF image and a second PAF image such as left andright PAF images as discussed herein. In some examples, PAF imagesinclude grayscale images associated with intensities measured orattained via pairs of PDAF sensor pixels (which may include conversionfrom RGB to YUV data). As discussed, in some examples, no separate andfull left and right images or image planes may be available, and insteada pixel stream from sensor 300 or 600 may be processed on-the-fly (e.g.,image processing and autofocus module 706 may have only one or two linesof a frame at a time). Similarly, left and right images as describedherein may include a stream of data associated with the left and rightimages (e.g. without full images being fully available at any time). Forexample, image processing and autofocus module 706 as implemented via animage signal processor (ISP) or a graphics processing unit (GPU) mayreceive PAF sensor data and provide PAF images (or portions thereof)on-the-fly and subsequent modules as described herein may process dataon-the-fly without attaining full image data or the like. It will beunderstood, however, that this may refer to initial processing untilregion of interest (ROI) values that may include multiple rows of animage are needed as described in detail below.

Imaging device 700 also may have one or more memories 708 that areprovided to a user from a manufacturing facility with golden sample data710, and as described below, may hold roughly average PDAF calibrationvalues considered to be the best available or ideal values. These may bestored in an EEPROM or device file system by some examples. The samegolden sample values may be set on many devices mass produced by amanufacturer, and for PDAF calibration, may include roughly averagephase-shift to lens offset conversion values per ROI (as describedbelow) and that are based on a batch of samples of a certain size. Thegolden sample also may include shading statistics that are initialaverage shading values for left, right, and regular image sensor pixelsper ROI as well.

Referring to FIG. 8, for efficiency and convenience, all of the sensorpixels on a sensor, and in turn the image it produces, referring to anentire statistics grid 800 that may be divided into a number ofstatistics grid cells 802 also referred to as ROIs or blocks forstatistics and processing. An ROI is a group of pixels 804 withconvenient sizes such as 250×250 pixels for a statistics grid with asize of 4000H×3000V pixels. The grid 800 may have a width w of 16 cellsand height h of 12 cells but many variations exist. Many computationsare performed on a per ROI basis, and this includes those for autofocuscalibration.

The image processing and AF module may perform autofocus by using thestored golden sample data 710 at first, which is then used to operatethe focus driver 720 and move a lens to a desired position to capture animage based, at least in part, on the phase shift to lens offset ROIgolden conversions. Initial golden shading averages also may be used toimprove the accuracy of difference metrics calculation between left andright type images. Once the image is captured, PDAF and regular imagesensor data may be provide to a run-time section 712 to process theimage data and provide autofocus for the next image.

Relevant here, the run-time section 712 may include components used torun the autofocus during operation of the device 700, and other run-timecomponents not relevant here are not shown. As will be explained indetail below, the PDAF self-calibration is performed by using the device700 and performing the PDAF self-calibration while the imaging device700 performs a number of iterations so that self-calibration data can beaggregated over a number of images to obtain accurate values, and whilea user can still obtain new images.

The run-time section 712 may include a PDAF unit 711 with an ROI phaseshift unit 714 (also may be referred to as an accumulated phasedifference module) that receives PAF images and ROIs (or equivalentinformation) from image processing and autofocus module 706 or memory.The ROI phase shift unit 714 may determine, for the individual ROIs,accumulated phase difference values (APDVs) that are a sum of the phaseshifts in an ROI that can be used to form the reliability valuesdescribed herein. As used herein, the term difference may refer to thedifference between two phase autofocus pixels next to each other (e.g.,pairs of autofocus pixels) or otherwise paired for a phase shift, inwhich one pixel is receiving light from the left (or top) side of anaperture and the other pixel is receiving light from the right (orbottom) side of the aperture. As discussed, left and right are used forthe sake of clarity of presentation, but any opposing or opposite sides(e.g. top and bottom or the like) may be used. As discussed, the pair ofphase autofocus pixels may be next to each other (e.g., adjacent orspatially close). In some PDAF-MS examples, the pair of phase autofocuspixels are diagonally next to each other (e.g., as Gr and Gb pixels arenext to each other in the Bayer quad), and the pair of phase autofocuspixels may have some distance between them. Otherwise, the pair of phaseautofocus pixels are formed as adjacent PDAF-DP photodiodes forming awhole pixel.

For the run-time determination of phase-shifts, by one form all pixelsin an ROI may be used to calculate one phase shift estimate per one ROI.That is, difference metrics L vs R may be calculated for certaintentative phase shifts (sum of absolute differences SAD can be thedifference metrics), e.g. tentative phase shift=[−5, +5], integer valuesonly. Then, the sub-pixel accurate final phase shift is interpolatedbased on the tentative phase shift that gives the smallest differencebetween L and R, and the two tentative phase shifts on left and rightside of that tentative phase shift.

Regarding the reliability value again, the accumulated phase differencesmay be used to determine a reliability value for individual ROIs by areliability generation unit 716. The reliability value indicates thereliability or confidence of a selected phase shift for an ROI, and byone form, only those ROIs that have a high reliability value are used todetermine the final focus phase shift by a focus phase shift (FPS) unit718. Alternatively, contrast AF or other AF techniques may be usedinstead of PDAF when the phase shift is not reliable for an ROI thatshould be focused on a certain object in an image, and where thatcertain ROI in a certain position must be used (such as when an objectis selected based on e.g. face detection, or manually selected by theuser, and it cannot be changed). In general, the ROI selection algorithmis a separate part of AF, also using face detection, or then overriddenby manual user selection. The focus phase shift is then provided to theimage processing and AF module 706 to apply the PDAF calibrationconversion to obtain a lens offset from at least one of the focus phaseshifts, and then to drive the lens motor when PDAF is used for aniteration. The conversion is obtained from the golden sample data 710 atfirst but then the final or adjusted ROI lens offset calibrationconversions 750 are provided when the PDAF self-calibration is completeas described below.

In some examples, depending on the reliability value, the imageprocessing and AF module 706 may implement a hybrid autofocus systemincluding phase detection autofocus and contrast based autofocus. Forexample, when the reliability value is high, the digital camera may usethe focus phase shift to determine a lens position shift (e.g. based onmotor units or the like), shift the lens position, and provide autofocusto a user based on phase autofocus. The reliability value may becompared to a heuristically determined threshold to determine whether itis sufficiently high. Such an autofocus may be fast and withoutovershoot. In examples when the reliability value is low, the digitalcamera may employ contrast based autofocus or a combination of phaseautofocus and contrast based autofocus to determine a lens positionshift, shift the lens position, and provide autofocus to the user.Contrast AF or any other AF technique may be implemented by the other AF(OAF) unit 713.

In some implementations, the reliability value may be generated bydetermining, for an ROI, the accumulated phase difference valuesassociated with phase shifts for both the left and right phase autofocusimages received via pairs of PDAF sensor pixels. Specifically, thereliability generation unit 716 obtains multiple candidate phase shiftsby applying an algorithm to obtain the accumulated L vs R differencemetrics values at multiple phases shifts between the left and rightimages formed by the left and right sensor pixels, say −5 to 5 or from−7 to 7, and this may be in sub-pixel accuracy. The accumulateddifference values are then graphed. A curve fitting may be performedbased on the accumulated difference values and phase shifts to generatean accumulated difference values fitted curve, and the reliability valuemay be generated based on the fitted curve (e.g., an analysis of thefitted curve). The curve analysis may include analyzing (1) the dynamicaccumulated difference value range covered by the curve which indicateshow big differences there are between different tentative phase shifts(if the differences are very small, then most likely the ROI does nothave sufficient image details for reliable phase differencecalculation), (2) the symmetry of the curve in which higher symmetrycorrelates with higher confidence on the resulting phase shift, (3) thesharpness of a main valley of the curve in which sharper valleycorrelates with higher confidence on the resulting phase shift, due tomore distinct difference in difference metrics between correct andincorrect phase shift, (4) the number of sign changes in the derivativeof the curve which indicates if multiple tentative phase shifts giveequally good match between L and R, in which case the ROI containsrepetitive texture that does not result in reliable phase shift, (5)brightness near at ROI being analyzed which gives an indication of thesignal-to-noise ratio (SNR) and/or (6) signal-to-noise ratio (SNR) dataindicative of a measure of signal-to-nose ratio in an ROI whichgenerally indicates the level of undesirable interfering noise in thesignals, or any desirable combination of these characteristics orothers. Signal-to-noise ratio data, for example, may include an analoggain, lens shading correction (LSC) gain, a digital gain, an on-sensorgain, other gains, or signal levels, or the like. These factors may havevarious weights, and the measurements and weights of these factors maybe combined in an algorithm to generate the reliability value. Otherfactors could be used as well. The reliability generation unit 716 mayobtain the data to analyze these factors via the imaging processingmodule 706 or another component of imaging device 700. The details forgenerating the reliability or confidence value as well as more detailsfor providing PDAF is provided by U.S. Pat. No. 9,338,345, which iscited in full above.

As mentioned, the image processing and AF module 706 may convert thefocus phase shift (based on the reliability value) to a lens offset.This may be performed by first determining which one or more of the ROIsof all the ROIs on a full sensor are the important ROIs within a fieldof view (FOV) and that is to be used to set the lens offset forfocusing. A single lens position is set for each focus distance in eachimage. Specifically, when a scene has objects at varying distances tothe imaging device, such as a person in a foreground that is closer thana background in the scene, the autofocus algorithm may decide to focuson the person based on face detection and size of the face, or the factthat the person is the closest object and close to the center of theFOV. If there are multiple ROIs at varying distances to the person, andit seems those ROIs are equally important, then an average lens positionamong those ROIs could be used as the final lens position. Otherwise, asingle most central ROI for an object in a scene may be used. Manydifferent algorithms can be used for selecting the ROI to be used forthe final focus phase shift. Otherwise, a traditional “center focus” maybe used that uses the one ROI at the center of the image so thattypically the user is required to aim the imaging device on the objectto focus on, and recompose the image framing once focus has been locked.Again, many variations are available.

The computed or looked-up lens offset then may be provided to a focusdriver 720 to move the lens to the desired position. The autofocus dataindicating the lens offset may be provided in the form of a lensposition shift, an updated lens position, and/or a number of lens motorunits for driving the lens or the like. In one example, a number of lensmotor units may be determined based on a focus phase shift found on aPDAF look up table implemented by the image processing and AF module706. Otherwise, when contrast or other AF is running on an iteration, alens position is provided in the AF data provided to the imageprocessing and AF module 706. Once the image processing and AF module706 provides the autofocus data to focus driver 720, the driver 720 mayfocus imaging device 700 by adjusting a lens position of imaging device700.

While the imaging device 700 is running PDAF iterations, the run-timesection 712 will generate reliability values for ROIs on each imagecaptured and being processed when PDAF is being used, and that can beused for the PDAF self-calibration, while the image processing and AFmodule processes the raw image data and generates shading values foreach ROI and for each image that also can be used for the PDAFself-calibration. For these purposes, the imaging device 700 may have aPDAF phase shift to lens offset conversion calibration section 721 (orjust conversion calibration section) to perform the PDAFself-calibration to determine sample-specific phase shift to lens offsetconversions, and a PDAF shading calibration section 722 to perform thePDAF self-calibration to determine sample-specific shading averages.

Particularly, the conversion calibration section 721 has an ROIreliability assessment unit 724 that determines whether a reliability ofan ROI is sufficient to include a ROI in the self-calibrationdetermination. An ROI image data comparison unit 726 compares the imagedata of a current frame to a previous frame (or iteration) to determinewhether an ROI has a sufficiently similar image from iteration toiteration to be included in the self-calibration determination. Aniteration focus lens offset unit 728 then may be used to determine thefocus lens offset to move the lens from an iteration lens position to afocus lens position, and for individual ROIs. An iteration conversionunit 730 then generates local iteration conversions, and the localiteration conversions may be computed a number of times over a number ofiterations and a number of focus rounds of iteration sets until theconversions sufficiently converge (and again for individual ROIs). Theconversions of the rounds (and for individual ROIs) are then used by aphase shift to lens offset adjustment unit 732 to generate a finalconversion value to be applied to phase shifts to compute the lensoffsets during run-time. The final conversions per ROI are then storedin the ROI lens offset conversions 750 on memory 708 for use in focusingto capture subsequent images (this may be in the form of a look-up tablebased on a final conversion for each ROI). The details of operation ofthese components are provided below with process 1000.

The PDAF shading calibration section 722 may include an ROI and framecalibration tracking unit 734. The imaging device 700 runs through aninitial number of frames in order to self-calibrate the shading for thedevice. The shading is tracked per ROI on each frame, and the data forthe same ROI is aggregated from frame to frame until a sufficient numberof contributing shading values are used to determine an average shadingvalue for the ROI. The ROI and frame calibration tracking unit 734tracks how many frames contributed to the ROIs and which ROIs areconsidered to be calibrated.

A ROI flatness testing unit 736 is provided to test the ROIs to becalibrated to determine if the color image data of the ROI issufficiently flat for determining the shading because an average shadingof the ROI is not a sufficiently true or accurate representation of alarge variation of color in the ROI. This is true even when outliers areremoved as described below. Specifically, the L and R pixels of a PDAFpixel pair are not in exactly the same location (especially in MS-PDAF),and a phase shift between L and R for an out-of-focus lens position canalso introduce differences between L and R that is not due to shading.In order to concentrate on shading difference only, the ROI should haveflat image contents to limit changes in color that add other non-shadingdifferences.

A ROI brightness testing unit 738 is provided to test the ROIs to becalibrated to determine if the image data of the ROI is sufficientlybright for determining the shading. If the image is too dark, the imagedata from such an image capture is not sufficiently precise to determineshading statistics.

Once the data passes these tests, the PDAF shading calibration section722 has a left and right pixel shading calculation unit 740 thatcomputes the PDAF self-calibration shading average values of individualROIs to be stored as shading statistics and that can be used to adjustshading for subsequently captured images. The left and right ROI shadingaverages are based on a proportion of the last left or right ROI shadingaverage over the regular (image or non-PDAF sensor) pixel shadingaverage for the ROI. The left and right shading averages are the shadingaverage of the shading values of the left or right PDAF sensors,respectively, in the ROI. For the PDAF-MS system, the number of PDAFsensors involved may be significantly less than the regular sensorsinvolved. In the PDAF-DP system, the number of PDAF sensor shadingvalues involved may be about half that of the regular sensors. Theaverages also include an average of the respective relevant image dataof all frames with a valid ROI up to and including the current frame andfor the same ROI.

The PDAF shading calibration section 722 also has a ROI calibrationcomplete setting unit 742 that determines when all ROIs (whatever framecontributed to the calibration of an ROI) has been calibrated. Thus,some ROIs may need more frames to be calibrated than others due to theROI being skipped on some frames when not sufficiently bright or flatfor example. Once all ROIs of a full sensor are calibrated, the left andright shading values 752 of each ROI are stored in memory 708 by oneexample. As mentioned, the stored shading values may be considered partof PDAF statistics, and may be provided to perform similaritycomputations (such as SAD), and may be used for lens shading correctionduring run-time and on subsequently captured images.

It will be appreciated that each component, unit, module, and sectiondescribed herein may include those portions of code and/or hardware thatprovide the operations performed by that component, unit, module, andsection regardless of where any of that code resides or what additionalmodules, units, and so forth any of that code is considered to be a partof.

It will also be understood that more components may be provided atimaging device 700 than that described here such as encoders, decoders,transceivers, antennas, and so forth, much of which are mentioned inimplementations 1200, 1300, and/or 1400 described below.

Referring to FIG. 9, an example process 900 for self-calibration forphase detection autofocus is arranged in accordance with at least someimplementations of the present disclosure. Process 900 may include oneor more operations 902 to 908, numbered evenly. By way of non-limitingexample, process 900 may form at least part of a self-calibration phasedetection autofocus process for imaging device or system 100, 700, 1200,1300, and/or 1400 as discussed herein and where relevant.

Process 900 may include “receive, at an imaging device, initial phasedetection autofocus (PDAF) calibration data with the same values to beprovided to multiple imaging devices” 902. This refers to the uploadingof the same golden sample calibration values to multiple samples orcameras, which can be part of the production software/firmware of thedevice, prepared during development of that device, for example, andoffline before mass production. Usually the golden sample calibrationdoes not involve production line measurements, but may be stored in acamera parameter file that is part of the production software. So whenthe correct software/firmware is flashed into the device, the imagingdevice also gets all the non-sample-specific camera calibration andtuning data. By other forms, the initial data may be received from othermemory, hardware, or software on the imaging device that is notconsidered to be part of the golden sample. By one form, the calibrationdata may include a conversion factor (or characteristic) that may beused to convert phase shift to lens offsets, and may be provided foreach or individual ROI (or cell) of a sensor as described herein.Alternatively or additionally, the initial calibration data may includeshading statistics, and where the golden sample shading statistics mayinclude an initial left and right shading value for each or individualROI. The statistics also may include a shading value for non-PDAF pixelsin a PDAF-MS system for example versus a PDAF-DP system that already hasleft and right shading values for all pixels. By one form, the ROIshading values are averages of the relevant shading values at each ofthe pixels in the ROI. Thus, the left ROI shading value is an average ofthe left shading values of the pixels in the ROI, and likewise for theright and regular shading values. More details are provided elsewhereherein.

Process 900 may include “capture, by the imaging device, a plurality ofimages” 904, and particularly to perform the self-calibration over theplurality of images. By one form, this may be the first sequence ofimages that are captured when the imaging device is turned on the veryfirst time and fully operational. By other forms, the plurality ofimages for self-calibration may be used every time an imaging device isturned on. Other variations are contemplated. Also, it will beunderstood that while the images used should be in display order, theimages used for the calibration need not necessarily be consecutive.Images may be skipped due to image quality issues and sufficiency forcalibration (referred to as ROI validity) as explained in detail below.

Process 900 may include “generate, by the imaging device,device-specific PDAF calibration data comprising refining PDAFcalibration data by using the plurality of images” 906. As explained indetail below for the mapping of phase shift to lens offset to form aconversion factor, this operation may comprise iterations that includemoving the lens by using the initial (golden) calibration data to aniteration lens position, and capturing the image once the lens stopsmoving. This is repeated, whether or not PDAF or another AF technique isused, such as contrast, and until an iteration is performed thatestablishes a focus lens position. The difference between the iterationlens position and the focus lens position is used to determine a focusiteration lens offset for each or individual iterations. The focusiteration lens offset and iteration phase shift that is a result of theiteration lens position (whether or not the iteration phase shift isactually used to form the lens position for a next iteration) is used tocompute a local iteration conversion factor (or conversion) therebymapping the iteration phase shift to the focus lens offset. This isrepeated for multiple iterations so that a conversion factor is formedfor each or individual iterations. When the same sufficiently or similarconversion is formed from the multiple iterations, the generatedconversion is the conversion for a round of iterations, where a round isperformed to determine a successful focus upon an object in a scenebeing captured by the imaging device. This process then may be repeatedmultiple rounds, each with a plurality of the iterations, and where eachround may establish its own conversion factor from its iterations. Afinal conversion factor may be selected from the multiple roundconversion factors or may be some combination of the round conversionfactors such as an average. This final conversion factor then may beused to adjust or replace the golden sample conversion. This processalso may be performed for each individual ROI so that a conversionfactor for each ROI is saved for subsequent autofocus operations tocapture images. By one approach, only those ROIs with a sufficientlyhigh reliability value as described herein, and sufficiently low change(or slow or unmoving) image data from image to image are included in thecomputation.

Alternatively or additionally for shading, this operation may includedetermining (or refining) a left and right shading value for each ROI.This is calculated by dividing the average left shading value of theleft PDAF sensor pixels in the ROI by the average shading value of theregular image sensor pixels in the ROI. For a PDAF-MS system, this isthe average shading value of the non-PDAF sensor pixels. For the PDAF-DPsystem, this is the average of shading values of all the sensor pixelsin the ROI. This also could be limited to only those PDAF and non-PDAFsensor pixels providing the same color (chroma) values such as all greenfor PDAF-MS, or one shading value for each color (or certain color(s))in PDAF-PD. Each time an iteration is performed, a new average iscalculated for an ROI including the average shading values of the prioriterations with that same ROI. By one form, only those ROI that aresufficiently flat and sufficiently bright are used to compute an averageshading value so that ROIs on some iterations or frames may be skipped.This is repeated until all ROIs are calibrated, where an individual ROIis considered calibrated when the ROI has some predetermined number ofiteration (or frame) shading average contributions to the final shadingvalue of the ROI. The details are provided below.

Process 900 may include “providing the device-specific PDAF calibrationdata to be used to obtain, by the imaging device, image data of multiplesubsequent images” 908. Thus, the golden sample values including ROIconversion look-up tables (or conversion function values), and shadingvalues of the golden sample may be replaced or adjusted. These valuesare then used on subsequent images and remain unchanged unless a PDAFself-calibration update is desired.

Referring to FIG. 10A-10C, an example process 1000 for self-calibrationfor phase detection autofocus is arranged in accordance with at leastsome implementations of the present disclosure, and particularly formapping PDAF phase shift to lens offset to generate conversion factors.Process 1000 may include one or more operations 1002 to 1054, numberedevenly. By way of non-limiting example, process 1000 may form at leastpart of a self-calibration phase detection autofocus process for imagingdevice or system 100, 700, 1200, 1300, and/or 1400 as discussed hereinand where relevant.

The PDAF self-calibration processes may be performed when an imagingdevice is turned on and used to capture images specifically forself-calibration, or could be turned on and used by an end user for thevery first time (that is not performed only for calibration purposes forexample), or could be implemented each time the imaging device is turnedon, or some interval of uses such as every 10 times for example. Othertime points for performing the processes could be used as well. Relevanthere, the PDAF self-calibration is not limited to a carefully controlledlight environment with specified target scenes to capture images thatwould limit the calibration to the production line.

Process 1000 may include “obtain initial calibration data includinginitial lens offset conversion value(s)” 1002. As described with imagingdevices or systems 100 and 700 above, PDAF sensor pixels sense chromaintensity levels of a certain color, and by one example, in the greenspaces of a Bayer filter quad system. In a PDAF-MS system describedabove, two pixels, which may be in the green (or could be blue or red)spaces of the same Bayer quad are deemed left and right sensor pixels(FIG. 4). The PDAF pixel sensors are not necessarily limited to onecolor. In the PDAF-DP system, each color sensor pixel space in the Bayerquad has two photodiodes to form left and right phases as describedabove (FIGS. 5-6). Many alternative spacing and arrangements for theleft and right sensor pixels (or dual pixels) are contemplated asalready explained above, and each pair of matching left and right sensorpixel provides a left and right R, G, or B value.

Also as mentioned, golden sample data may be loaded onto (or otherwiseaccessible to) an imaging device and may include a conversion factor (orcharacteristic or just conversion) providing the mapping from phaseshift to lens offset. The conversion factor also will be referred to asa slope of a conversion function as explained below. As described above,the sensor statistics grid may be divided into ROIs or cells where eachROI may be a small area of sensor pixels such as 250×250 pixels. For aPDAF-MS system, at least one pair of PDAF sensor pixels left and right(or other direction designation) are located in each ROI, but often morethan 625 pairs, and by one form, the sensors pixels may be evenly spacedfrom each other in the ROI. For the PDAF-DP system, each or individualwhole pixels has left and right photodiodes in the ROI as describedabove.

Relevant here, the golden sample calibration data may include aconversion for each or individual ROIs. By one form, a look-up table maybe provided for each ROI that lists a range of phase shift values (ordisparities) on one column and a range of corresponding lens offsetvalues on the other column to avoid computations with a conversionfunction each time a lens offset is needed, such as that shown below:

TABLE 1 Simplified Example Disparity (Phase-Shift) to Lens OffsetLook-up Table L vs R Lens offset disparity (VCM units) −2.4 120 −1.2 600 0 +1.2 −60 +2.4 −120where −2.4 disparity (or phase shift) and 120 voice coil motor (VCM)lens offset units compensates for a backfocus, and +2.4 disparity and−120 VCM lens offset compensates for a front focus. Zero disparityindicates the correct focus. Such a look-up table may be provided foreach ROI on a full sensor. Note that the actual look-up table may havemany more rows and disparity values, as well as different values, butthat any computed disparity that is not exactly listed on the look-uptable may be computed by interpolation.

Alternatively, a conversion factor may be provided for each ROI instead.The conversion factor for table 1 is −50 assuming a linear conversionfunction such as:

LO=(PS)(C)  (1)

where LO is the lens offset, PS is the phase shift, and C is theconversion factor of the conversion function. Such a function is graphedon conversion function graph 1060 (FIG. 10D) as golden sample functionline 1062, described in detail below. When the conversion is a linearfunction, the conversion factor may be the slope of the function that ismultiplied by the disparity to compute the lens offset. Other functionsfor the conversion could be used as well. Some options may use an nthdegree polynomial (n>=2), spline, or any other 2D curve representationthat could be used to map one value into another (phase shift into lensoffset). In the example here, the linear function uses a slope andy-crossing at 0 as described (as in chart 1060).

Process 1000 may include “set iteration i=1” 1004, which is an iterationcounter used to track iterations for the sample process 1000 describedhere at least for initially performing image capture iterations toward acorrect focus, but may or may not actually be used. A set of theiterations may be considered a round, where the imaging system attemptsto obtain a correct focus on an object in an image to be captured by theimaging device. Each iteration includes (1) moving the lens of theimaging device according to a lens offset converted from a phase shiftof at least one of the ROIs in the prior iteration, (2) capturing animage, and then (3) computing the new phase shifts based on the lightcaptured for the image. Each iteration may be considered, or processes,a frame, image, or picture in a sequence of such units such as withvideo recording, but could be a series of still photographs whethercaptured quickly one after another or alternatively with uniform ornon-uniform time periods between images (for very slow or non-movingscenes with fixed camera position for example) or as long as thecriteria for a valid ROI sufficient for calibration computations issatisfied as described below.

Process 1000 may include “move lens and capture image according toinitial calibration data”1006. By one form, the first time an end useruses a camera to capture images, it actually may not be the first timethe imaging device is used. These PDAF self-calibration processes couldbe performed by the manufacturer except now careful conditions are notnecessary for the sample-specific PDAF calibration. Also, during theproduction, the imaging device may be turned on and used to captureimages for various quality testing and calibration reasons whether tosave set the golden sample for PDAF or other calibration settings. Byone form, the golden sample phase-shift to lens offset mapping is usedfor the mapping. During these operations, initial disparities may bemeasured by the sensor pixels of the imaging device, and may be savedbefore the imaging device is packaged and sent for sale to end users. Byother options, when the disparity phase shift camera actually is usedfor the first time and no phase-shifts have been previously stored, theimaging device may perform an initial exposure to capture light andmeasure the left and right PDAF disparities at the PDAF sensor pixels.This may occur if the user presses the actuator part way for example.The left and right phase shifts then can be averaged per ROI and stored.

Once the iteration phase shifts are obtained for the ROIs, one or moreROIs are selected for focus if not selected already as mentioned abovewhere an ROI must be used since it focuses on a selected object in ascene (or image). The iteration phase shifts are converted to lensoffset per the golden sample calibrations, and this could be adetermination based, at least in part, on the reliability value of theROIs for subsequent iterations as discussed herein. The lens then may bemoved the VCM units indicated by the selected lens offset. The lens ismoved based on the phase shift of at least one of the ROIs selected asexplained above. The lens also actually may be moved by using PDAFautofocus using the golden sample calibration values, contrastautofocus, or another autofocus technique also which may or may not beat least partly dependent on the reliability value if present. After thelens is moved, an exposure or integration is performed during which thesensor pixels capture light, which is processed and turned intograyscale values as described above.

Process 1000 then may include “obtain statistics for currentiteration”1008, and by one form, the new statistics are obtained onlyafter the lens has stopped moving. While the lens is moving, the sensedlight is not attributable to a single lens position, and could includelight from varying light ray angles due to the varying lens position,which would provide inaccurate results. Once the lens has stoppedmoving, the image is captured (light is sensed), and this operationinvolves analyzing the sensor data to “determine phase shift forindividual regions of interest” 1010, and specifically by retrieving thePDAF left and right pixel data pairs (whether MS or DP) which aregrayscale values by one example, differencing the data of the pairs, andaveraging the difference for individual or each ROI.

By one form, all ROIs of an image are analyzed for PDAFself-calibration. By another form, only those ROIs that are focusing ona particular object in the image are analyzed. In other words, the PDAFself-calibration may be performed for those ROIs that are focused on acertain object in the image when there are multiple objects in an imageat multiple depths. In this case, the ROIs that are not focused on theobject will not come into focus during the self-calibration. By oneform, the object may be a foreground, such as a person, versus abackground, or vice-versa, and may have any number of objects, where theROI are self-calibrated per object. The self-calibration may be repeatedfor each object distance until all ROIs of the image are calibrated.

Process 1000 may include “determine reliability value for individualregions of interest”1012, where a reliability or confidence value isdetermined as part of the statistics and based on an analysis of a curveof accumulated phase differences versus candidate phases shifts for anROI. The details of one methodology to obtain the reliability values forindividual ROIs is summarized above and is disclosed in detail by U.S.Pat. No. 9,338,345, issued May 10, 2016, and titled RELIABILITYMEASUREMENTS FOR PHASE BASED AUTOFOCUS, which is incorporated herein inits entirety. The reliability values are used as explained below.

Once the phase shift statistics and reliability value are obtained forthe ROIs of an image, process 1000 may include the query “i>1?”1014,simply to test whether the first iteration is being handled. When thefirst iteration is being handled (where i=1), the process jumps tooperation 1036 to obtain the next iteration. In that case, process 1000includes “set next iteration i=i+1” 1036. The next iteration (now thecurrent iteration while the first iteration is now the previousiteration) is then performed, and process 1000 includes “move lens andobtain image data of next available iteration i after lens stops moving”1038. Thus, the next iteration is of the image captured after the lensstops moving. The images captured while the lens is moving are skipped.Thus, the current and previous images are not necessarily consecutive ina sequence of images being captured, just consecutively available forPDAF self-calibration.

The phase shift (if present) from the previous iteration (which was thefirst iteration) is used to move the lens to a position that is thenused to capture the current frame (for the current iteration). In otherwords, the phase shift that has been calculated from a frame i (PS_(i))is used to determine how the lens is to be moved to capture frame i+1(or i+2 if lens movement is too slow to finish before i+1), whereLO=C*PS_(i). If PDAF was used, and a phase shift is present, which ROIto use to set the lens offset and which AF technique to use on the nextiteration(s) (PDAF, contrast, or other AF technique) could be based atleast in part on the reliability values of the ROIs as explained above.Continuing with the PDAF example, the previous phase shift becomes theprediction disparity for the current iteration. Once the lens is movedin the current iteration, the current image is captured, and image datais collected as mentioned for the first iteration. Then, the process1000 loops back to operation 1008 to analyze the current captured imagedata and collect current statistics for the current iteration includingthe new ROI iteration phase shift and reliability computations asdescribed for the first iteration.

Now when a subsequent iteration is being processed, the answer to thequery at operation 1014 to determine if the current iteration is not thefirst iteration is yes, and process 1000 continues with “set ROI ofiteration at R=1” 1016, where an ROI counter is now used to track theROIs being validated for calibration in the current iteration. As apreliminary operation to ROI analysis, process 1000 may include“determine validity of ROI R” 1018. Accordingly, process 1000 mayinclude the query “reliability value high?”1020. This may includedetermining whether the ROI has a sufficiently high reliability value.If not, the ROI may be based on bad data depending on the scene andconditions for capturing an image of the scene that will not result inan accurate phase shift for the ROI for the reasons provided above withthe description of the reliability generation unit 716 on device 700(FIG. 7). The threshold may be predetermined and may be set byheuristics. This threshold may or may not be the same threshold used todetermine whether PDAF or contrast autofocus is to be applied, which ROIto use for the lens offset, or used to make other autofocusdeterminations based on the reliability of the ROI. The setting of thethreshold may depend on the algorithm details of the reliabilitycalculation, and experimental results to set the threshold performeduntil the calibration becomes sufficient. If the reliability is [0%,100%], the threshold could be e.g. 95% by one example.

As another validity test, process 1000 may include the query “ROIbetween i and i−1 sufficiently close image data?”1022. This testswhether the image data of ROI R in two PDAF self-calibration images fromtwo consecutive PDAF self-calibration iterations has changedsubstantially in grayscale, which may indicate a change in chroma aswell. Such change could be caused by motion of the objects in the imageor motion of the imaging device itself. This may be determined by a SAD,cross-correlation, local motion estimate calculations, gyroscope and/oraccelerometer values, or other computation with the sensor pixel valuesin the ROI R from the current and previous iteration. If there is toomuch change in pixel image data values (the grayscale values but couldbe chroma values or both) of an ROI, and from iteration to iteration,then results will not be sufficiently accurate because the phase shiftsmay change too radically from iteration to iteration to form a basis ofcomparison of iteration to iteration while computing a conversion factorused over multiple iterations. The threshold here also may be determinedby heuristics. By one example, local motion estimation is used to ensurethat camera is not moving too much with respect to the target object tobe focused on. For example, local motion is less than 10% of the ROIsize.

Process 1000 may include “do not include phase shift of ROI R todetermine prediction error”1024, if the current ROI R does not pass oneof the tests, and is then skipped. Otherwise, process 1000 may include“include phase shift of ROI R to determine prediction error” 1026. Ineither case for the present example process, before analysis of the ROIor obtaining the next ROI, process 1000 may include the query “lastROI?”1028, to determine if the last ROI of an image was just tested forvalidity. If not, process 1000 may include “obtain next ROI R=R+1” 1030,and the process loops back to operation 1018 to determine the validityof the next ROI. This is repeated until all of the ROIs that are to beused, at least when the entire image is not being analyzed and only theROIs focused on an object being analyzed, have been tested for validityby this example. Alternatively, all ROIs of the sensor, and in turn theimage, can be tested.

It will be understood that other alternatives exist where each ROI isanalyzed for PDAF calibration after being validated, before all otherROIs are being analyzed for validity. The order of operations shown hereare for simplicity and convenience purposes and may not be the actualorder of operations used (where all ROIs of an image are tested forvalidity first before iteration conversion analysis).

Continuing with process 1000, once all of the ROIs on an image (orfocused on an object in the image) are tested, and those validated ROIsto be calibrated are determined as just discussed, process 1000 thenincludes “perform run-time autofocus for iteration i” 1032. In otherwords, as the iterations are being performed thereby forming a sequenceof images, autofocus operations are being performed to obtain a correctphase shift and lens offset, and in turn a correct focus. This can beperformed by PDAF, contrast autofocus, or some hybrid which may or maynot include other focus techniques, and until the correct or optimalfocus is determined for one of the iterations. By one example, theiterations may start with PDAF where autofocus is considered to beperformed on one iteration. The PDAF may be repeated if an error occursand the phase shift (or lens offset) is very far from correct focus anduntil the phase shift is relatively closer to zero. Then contrastautofocus may be used to achieve the proper precise focus and correctfocus lens position. Thus, for example, if the results show a relativelylarge phase shift that is not considered close to a zero phase shift,such as a −2.0 phase shift and 100 VCM lens offset by the example of theGolden sample (Table 1 above), then PDAF may be used again in the nextiteration. However, when the phase shift is close to zero (such as +0.5on the look-up table 1), then contrast autofocus (contrast AF) may beused thereafter.

In conjunction with the run-time autofocus, process 1000 provides “doescurrent iteration have correct focus lens position of individual ROIs”1034. When PDAF is being used, and when the resulting phase shift from alens position is zero or sufficiently close to zero in an iteration,that iteration is deemed to provide the correct focus and correct focuslens position. Alternatively, when contrast AF is being used, eachiteration may be a contrast AF iteration that determines the totalcontrast of both PDAF and regular sensor pixels from captured image datafor an ROI and in that iteration. The contrast AF seeks the iterationwith the maximum contrast and deems that iteration to have the correctfocus lens position. The contrast AF may have the lens moved in apredetermined short or fine adjustment distance for each iteration (maybe 5 VCM by one possible example) and captures an image and light ateach iteration to measure the contrast until a maximum contrast isreached and may perform an overshoot to achieve this. To demonstrate,say the iterations N to N+6 are being analyzed in sequence for contrastAF. The contrast increases for each iteration up to N+5. At N+6, thecontrast decreases revealing that the maximum contrast, and correctfocus lens position (which may be referred to as LP_(F)), is determinedby iteration N+5. This may be performed for individual ROIs that arevalidated and are being included in the analysis (when the entire imageis not being analyzed).

If the current iteration does not generate a correct focus lensposition, the next iteration is retrieved by operations 1036 and 1038already described above, and the process loops back to operation 1008again to analyze the next iteration. As mentioned, this could be one ofthe iterations in a multi-iteration run-time autofocus operation, suchas contrast AF. In that case, the image data of from PDAF left and rightsensor pixels still may be used to generate phase shifts, even thoughthe phase shifts will not be used in a non-PDAF autofocus iteration.This may be performed in order to be able to perform the PDAFself-calibration on the non-PDAF iteration later. In addition, it willbe understood that the phase shifts may be generated for each iterationanyway to form statistics used for other non-PDAF autofocus operationsor other non-autofocus operations by the imaging device (such as depthmap generation for augmented reality purposes.).

The process 1000 may include “determine focus lens offset to be used atprevious iterations in round” 1040. Particularly, once the iterationwith the correct focus is determined, the focus lens position (LP_(F))is known. As mentioned, the individual iterations of a round at leastuntil the iteration with the correct focus has a motion of the lens to alens position, light is sensed by the sensor pixels (or an image iscaptured), and the phase shift of the iteration is then determined fromthe captured image data as described above with a phase shift beingdetermined from the left and right sensor pixels (or dual pixels) andfor each ROI. The iteration lens position established at each iterationis LP_(i) and the resulting phase shift from the lens position LP_(i) isPS_(i) for each ROI. When the conversion is correct, PS_(i) multipliedby the conversion C (and at first the golden sample conversion C_(G))should equal the focus lens offset LO_(F) to the correct focus positionLP_(F), and as plugged into equation (1) above. In a more generic form,LO_(i)=C(PS_(i)), which permits other conversion functions than linearones that cross the y-axis at 0 (e.g., LO_(i)=C*PS_(i)+y_crossing).Otherwise, a look-up table approach could be used as described herein.However, for the iterations other than the iteration with the correctfocus lens position, LP_(i) is not the correct focus lens position.Thus, to determine what the lens offset LO_(i)′ should have been for theiteration i to move the lens from the lens position LP_(i) to the focuslens position LP_(F), the difference between the two lens positionscorresponds to the lens offset LO_(i) to obtain the focus lens positionat the iteration, which may be recited as follows:

d=LP_(F)−LP_(i)  (2)

LO_(i) ′=f(d)  (3)

where d is the distance between the actual lens position at theiteration, and focus lens position that should have been established atthe iteration. The distance d is placed into some known function f( )that converts lens position into lens offset value in VCM units to movethe lens the distance d. This is repeated for each iteration in thecurrent round and for each valid ROI being analyzed in the iterations.It should be noted that each iteration can have a different focus lensoffset LO_(i)′ because the actual iteration lens position LP_(i) can bedifferent for each iteration. Within a single iteration, however, thefocus lens offset LO_(i)′ is the same for each ROI even though the phaseshift PS_(i) is different from ROI to ROI if the ROIs are at differentdistances from the camera. The PS_(i) of the iterations is the resultingPS from the different pairs of PDAF sensor pixels (or dual pixels) inthe ROIs based on capturing light with the lens at lens position LP_(i).The PS_(i) is now being used to determine what conversion factor C_(i)should have been applied to obtain the focus lens offset LOi′.

Accordingly, by one form, once the ROI has the corrected focus lensoffset LO_(i)′ for each of the iterations in a round, process 1000 thenincludes “determine iteration focus conversions” 1042. For the examplehere, the generation of conversions for a single ROI may be generatedbefore analyzing the next ROI. Alternatively, the conversions can bedetermined for all participating ROIs in a single iteration and theniteration by iteration. Here, once the correct focus lens offset LO_(i)′is determined for an iteration, the conversion factor to provide thecorrect mapping of the phase-shift to lens offset can be determined forthe individual ROIs at that iteration as follows:

C _(i)=LO_(i)′/PS_(i)  (4)

where C_(i) is the correct conversion factor or conversion functionslope that should have been used to move the lens from the iterationlens position LP_(i) to the correct focus lens position LP_(F) by usingthe correct focus lens offset LO_(i)′ and the phase shift PS_(i) of anROI. This is repeated, for each ROI being analyzed, in each of theiterations in a round. The result is a sequence of conversion factors(C₁, C₂, C₃, . . . ) for each ROI and from iteration to iteration up tothe iteration that provides the actual focus lens position.

Thereafter, process 1000 analyzes the computed conversion factors C_(i)of the iterations in a round and for an ROI. Particularly, process 1000then may include “determine self-calibration conversion factors of roundhave sufficiently converged”1044. If each iteration consistentlyindicate the same or similar conversion factor C_(i) should have beenused, and in turn, the same or similar adjustment in the mapping look-uptable for this ROI, then the adjustment (or conversion factor value) isstored for the round.

Referring to FIG. 10D, and in more detail, when the conversion factorsC_(i) of each or some minimum number of individual iterations are thesame or very similar, it shows that the iterations follow a linearconversion function, and the conversion factor C_(i) should have beenprovided to compute the focus lens offset as the slope of the function.For example, graph 1060 shows the mapping of phase shift to lens offset.The solid line 1062 shows the linear conversion function for the goldensample with conversion factor or slope C_(G). Now, when the iterationsare being analyzed by using the focus lens offset LO_(i)′, by theillustrated example, each iteration establishes the same or a similarconversion factor C_(i), where for example the differences between C₁,C₂, and C₃ for iterations 1-3 are zero or close to zero. Thisestablishes the linear function shown by dashed line 1064. When such alinear function is established by determining the focus conversionfactors are the same or sufficiently similar, the correct focusconversion factor for self-calibration is established for this round ofiterations (or in other words, there is sufficient convergence of theconversion factor). In contrast, say conversion factors at the iterationestablished points 4-6 (shown in dashed line) where there is nosimilarity in conversion factor. In this case, no convergence isestablished for the round, and the round is dropped. However, whenconvergence does exist, for one possible example, assume the correctconversion factor may be −46.67 (forming the values below on look-uptable 2), and this conversion factor may be stored. It is not used toadjust the golden sample (table 1) yet. This is performed when asufficient number of rounds are complete and show that the conversionfactor is correct (or sufficiently converged over a number of rounds) asdescribed below.

TABLE 2 Corrected Example Disparity (Phase-Shift) to Lens Offset Look-upTable L vs R Lens offset disparity (VCM units) −2.4 100 −1.2 50 0 0 +1.2−50 +2.4 −100

In order to deem the conversion factors sufficiently converged, theconversion factors should be within +/−5% of each other. This may bedetermined by Heuristics, and the criteria for sufficiently convergedcan be determined empirically.

Also to establish a converged conversion factor for a single round, anindividual ROI should have some minimum number of conversion factors, orin other words, a minimum number of iterations or conversion factorcontributions from the iterations in a round. In addition, the startinglens position should be far enough from correct in-focus lens position.This could be a minimum of two iterations or contributions, and lensposition distance could be at least 20% of total lens movement range.However, it will be appreciated that individual ROIs may need adifferent number of iterations than other ROIs to obtain a sufficientnumber of iteration contributions of conversion factors due to some ROIsbeing invalid on some iterations according to the validity testsprovided above.

To continue, process 1000 then may include the query “conversion factorssufficiently converged for the round”1046, and for an individual ROI,and repeated for each ROI being analyzed. This may refer to both thenumber of conversion factor contributions as well as the differencesbetween the conversion factors among the iterations. If one of these areinsufficient, the round that did not properly converge is simply droppedand omitted from the analysis, and process 1000 continues with “beginnext round” 1048, and process 1000 loops back to operation 1004 to startwith a new iteration 1 for the next round. In this case, the goldensample look-up tables (or conversion factors) still will be used todetermine the lens offsets for the repeated iterations until a round isestablished that has a sufficiently converged conversion factor, C_(i).For PDAF iterations, the lens is still moved according to thegolden-based lens offsets as well.

Otherwise, process 1000 may continue with “repeat for predeterminednumber of rounds that conversion factor is sufficiently converged” 1050before changing the golden sample PDAF calibration data. As mentioned, afocusing round refers to the whole process of focusing on some object ina scene being captured, and which may include multiple image frames fromthe camera sensor, multiple AF analysis iterations, and moving the lensmultiple times. The focusing rounds may be separately initiated when auser half-presses the shutter button in a digital still camera (DSC) orDSLR, or presses the capture button in a mobile device. During acontinuous AF, subsequent focusing rounds after the first round arestarted when, for example, it is noticed that the ROI has become out offocus, and/or when a scene has changed significantly. A round ends whenthe scene is stable and the ROI is in focus again. By one form, thecalibration is updated only when the focusing round (or the latterstable part of it) has been performed in a stable scene, such as whenthe camera is not panning and the scene contents are not substantiallymoving. By one form, determination of a converged final conversion isreached when the same or similar conversion value is generated at someminimum number of rounds, such as 5 rounds, are preformed where eachround is required to have a minimum number of iterations for each ROI,such as 2 frames (or iterations or lens positions), as mentioned above.

Process 1000 may include “adjust phase shift to lens offset conversiondepending on final conversion”1052, where the final conversion is theconversion factor determined from the multiple rounds. When theconversion factor of the rounds are not the same, those that are veryclose, such as within +/−5% may be combined, such as by an average orother combination such as trimmed mean filter, to form the finalconversion. By one form, outlier rounds that converge to a conversionfactor but one that is significantly different than the conversionfactor of other rounds could be left out of the combination as well.

By one form, the final conversion factor from the rounds are used toform a new look-up table stored for individual ROIs. Thus, the goldensample mapping of phase shift to lens offset conversion look-up tables,or data, is then adjusted (including being replaced). For example, table2 above may replace table 1 for the individual ROIs. By other forms,just the conversion factor is stored for each ROI.

Process 1000 may include “store conversion for subsequent run-time”1054,where the new PDAF self-calibration data is stored for future autofocusoperations, and may not be changed again. Alternatively, as mentioned,the PDAF self-calibration may be updated each time the imaging device isturned on. The PDAF self-calibration could be used at other time aswell.

Referring to FIG. 11A-11B, an example process 1100 for self-calibrationfor phase detection autofocus is arranged in accordance with at leastsome implementations of the present disclosure, and particularly fordetermining sensor pixel shading values to generate shading statistics.Process 1100 may include one or more operations 1102 to 1134, numberedevenly. By way of non-limiting example, process 1100 may form at leastpart of a self-calibration phase detection autofocus process for imagingdevice or system 100, 700, 1200, 1300, and/or 1400 as discussed hereinand where relevant.

Process 1100 may include “obtain initial calibration data includinginitial average shading values of left and right PDAF pixel pairs andnon-PDAF image pixels per ROI” 1102. Particularly, shading statisticsmay include average shading values for individual ROIs. The ROIs are asdefined above as a division or a cell of sensor pixels on a statisticsgrid where an ROI could be about 250×250 pixels while the statisticsgrid is divided into 16×12 ROIs forming the statistics grid by oneconventional example. The shading refers to average shading values,which may be provided for one or more color channels. Thus, for example,when a PDAF-MS system is being used, the PDAF sensor pixel pairs may beplaced in the green locations (the Bayer Gr and Gb locations as shown onsensor 310 (FIG. 4) for example). For the golden sample statistics,images are captured of a flat field target or object where color andluminance do not vary significantly and by a golden sample imagingdevice. Then, each PDAF sensor pixel pair may provide a left green valueand a right green value. All of the left and right green values (or leftand right shading values) in an ROI then may be averaged separately todetermine left and right ROI shading values. These left and rightshading values are placed on a shading statistics grid stored as part ofthe golden sample. For PDAF-DP systems where PDAF sensor pixel pairs areprovided on all of the color sensors (red, green, and blue), left andright ROI shading values may be provided for each color channel so thateach ROI has three sets of left and right ROI shading values (red,green, and blue).

The PDAF self-calibration process for shading statistics may beinitiated upon first turning the imaging device on to capture images byan end user (or at the manufacturing plant except without preciselycontrolled conditions), upon each time the imaging device is turned on,or other variations as with the PDAF self-calibration for the mapping ofphase shift to lens offset.

Process 1100 may include “set frame F=1” 1104, where here a frame oriteration counter is set to analyze each frame and aggregate shadingvalues over a number of frames as described below.

To begin the frame analysis, process 1100 may include “move lens andcapture image according to initial calibration data” 1106, where animage is first captured using the golden sample including the goldenphase shift to lens offset data as well as the golden shadingstatistics. This creates left and right PDAF sensor pixel values as wellas non-PDAF regular sensor pixel values.

Then, process 1100 may include “set ROI of frame F at R=1” 1108, tosetup an ROI counter in order to analyze each ROI of a frame, or atleast those ROIs that are to be analyzed if not an entire image. By oneform, generally speaking, it does not matter whether a specific ROI isfocused on a particular object in a scene being captured. Here all ROIsare being analyzed that are considered valid as long as the image datais sufficiently bright and sufficiently flat as defined further below.

Process 1100 may include a query “ROI R calibrated?” 1110, where firstthere is a check to determine if the current ROI R already is deemedcalibrated. If not, the process continues with operation 1126 whereprocess 1100 includes “obtain next ROI R=R+1”, and the process loopsback to operation 1110.

If the ROI R has not been calibrated yet, process 1100 may include“check validity of ROI” 1111. If valid, the ROI will be included in theanalysis. If not, the ROI is skipped until the next frame. This mayinclude checking if “ROI sufficiently flat?” 1112 to determine whetherthe image data in the ROI has a sufficiently uniform color. By one form,the color component values of the ROI for this test include both PDAFsensor pixel values and non-PDAF sensor pixel values, and of the colorpixels of the single channel being analyzed (green, red, or blue) at atime. For PDAF-DP, this may be performed three times each on respectivesensors of a particular color when all three channels are being tested.By one form, for PDAF-MS, only the green channel is being tested so onlythe green sensor values are analyzed for flatness here, but other colorsand combination of colors can be used as described above. By anotheralternative, all values of all sensor pixels in a ROI are included. Toperform the test, the color values from the highest to the lowest thatare included in the test should not vary by more than 5% in order forthe ROI to be valid.

Process 1100 also may include “ROI sufficiently bright?” 1114, where theluminance (or grayscale) values of the ROI may be tested to determinewhether the ROI has a sufficiently high brightness. This may be testedin a number of different ways. By one form, all pixel (RGB) values inthe ROI must be over a threshold. By another form, an average of all ofthe pixel values of a ROI must be over a threshold. By yet another form,all pixel values or the average pixel value of only those sensor pixelsof the color channel being analyzed (such as all green) are included inthe test. The threshold is determined empirically and may be 20% of themaximum value.

Both tests can be checked from the filter response grid (AF-grid) andlow resolution representation of the image (RGBS-grid), both of whichare part of 3A statistics for many imaging devices. The filter responsegrid indicates if there are edges or texture present in ROI area, andthe low resolution representation of the image indicates the brightnessof each color component in the ROI area

If the ROI does not pass one of the validation tests, the process 1100loops to operation 1126 again to obtain the next ROI. If the ROI doespass the two validation tests, then process 1100 proceeds with computinga new left and right calibration shading value for the ROI.

Accordingly, process 1100 may include “determine left shading value ofROI R depending on average left shading value in ROI R from frames F sofar and regular average shading value in ROI R from frames F so far”1116. Here, the left shading value of the ROI may be determined by:

PDAF_shading_L(ROI)=Left_Avg(ROI)/Regular_Avg(ROI)  (5)

where PDAF_shading_L(ROI) is the left shading value of the ROI,Left_Avg(ROI) is the average pixel value of the left PDAF sensor pixelsin the same single ROI. Equation (5) is used for each frame, and thenaveraged as the frames are added. As mentioned, this may be performedper color channel, and could be performed separately for multiple (R, G,B) color channels.

The Regular_Avg(ROI) is the average of the pixel values of all of thenon-PDAF sensor pixels of all colors in an ROI by one example. By otheralternatives, the Regular_Avg(ROI) is the average of pixel value of onlythose non-PDAF sensor pixels with the same color channel as the PDAFsensor pixels (such as all green for the PDAF-MS example) for a PDAF-MSsystem. When multiple color channels can be analyzed separately as withPDAF-DP system, then a Regular_Avg(ROI) may be computed for each colorchannel. By yet other alternatives, the Regular_Avg(ROI) is the averageof all sensor pixels in an ROI whether PDAF or not, and no matter thecolor. Other variations exist as long as the Regular_Avg(ROI) is thesame to determine both left and right shading averages, but providesmore accuracy when the Regular_Avg(ROI) is the same color as Left orRight_Avg(ROI).

As mentioned, the left shading value for the ROI (PDAF_shading_L(ROI))is the average of both the shading values specified in the current ROIas well as the shading values specified in the same ROI in previousframes (where the ROI is valid) up to the present current frame, and ascomputed as mentioned above. This permits a relatively large sampling tobe used to determine a shading value thereby increasing the chances ofobtaining a more accurate shading value that is not unduly influenced byoutlier shading values or concentrations of shading values.

Process 1100 may include “determine right shading value of ROI Rdepending on average right shading value in ROI R from frames F so farand regular average shading value in ROI R from frames F so far” 1118.As with the left shading values, the right shading value of an ROI maybe determined by:

PDAF_shading_R(ROI)=Right_Avg(ROI)/Regular_Avg(ROI)  (6)

where the definitions of these terms are the same as those for the leftshading value except labeled right and obtaining right PDAF sensor pixeldata. Otherwise, the same operations from the left are applied here forthe right. Equation (6) is applied to each frame, and then averaged asthe frames are added.

By one alternative form, a trimmed mean filter also may be used thateliminates a number of the lowest and highest shading values (whetherleft, right, or regular) also to remove outliers. By one form, threehighest and lowest values are removed form a shading value population ofabout at least 20 shading values. The number trimmed could be a fixednumber or could be a percentage of the total number of shading valuesbeing averaged, or some other variation. Whether or not this option isused, a minimum number of frames may be required to establish a validleft or right ROI shading value to make sure that a sufficient number offrames contribute to the left and right ROI shading value for any oneROI.

Thus, process 1100 then may include the query “sufficient number offrames to mark ROI R as calibrated?” 1120, such that each ROI must havea sufficient number of frames to contribute to the left and rightshading value average. By one form this is at least 300 frames (10seconds at 30 fps if all frames are valid), and is determinedempirically. This may be different for a PDAF-MS system where only a fewPDAF sensor pixels are placed in each ROI versus a PDAF-PD system wheremany PDAF dual sensor pixels exist. It should be noted that due toinvalid ROIs, some ROIs may be deemed calibrated at later frames thanthe calibration frames of other ROIs.

When a sufficient number of frames have contributed, process 1100 mayinclude “mark ROI R calibrated” 1122, and the current ROI across somenumber of frames is now considered calibrated, and will not be analyzedagain. Process 1100 then may include the query “max ROI R of frame F?”1124, to determine whether the analysis of the current frame iscomplete. If not, process repeats operation 1126 to obtain the next ROIand loop back to operation 1110 to analyze the next ROI. If the last ROIof the frame was analyzed, then process 1100 may include the query “allROIs calibrated?” 1128, to determine whether self-calibration of shadingstatistics is complete. If any ROIs still need to be calibrated, thenprocess 1100 may include “set frame F=F+1” 1130, and “obtain shadingdata of frame F” 1132, where the image data of the next frame isobtained for shading calibration of the ROIs still needed to becalibrated. In this case, the process 1100 then loops back to operation1108 to analyze the remaining uncalibrated ROIs on the next frame F.

When all of the ROIs of the sensor (or frame or image) are calibrated,process 1100 then may include “store shading values for future run-timeuse” 1134. Now at this point, the golden sample left and right shadingstatistics grids are replaced or adjusted to list the new values fromthe calibrated ROIs. It should be noted that by one example form, thestatistics grid lists the left and right shading values to permit theparticular application (such as autofocus) to determine any left andright disparities since some applications need to use the separate leftand right values.

One example Pseudo code for the operation explained above could berecited as:

update_PDAF_shading_calibration( ) { if not PDAFshading_calibration_ready( )  { for each ROI as determined byPDAF-Statistics grid { if ( not already_calibrated(ROI) &&valid_for_shading_calibration(ROI) ) { PDAF_shading_L(ROI) = Left_Avg(ROI) / Regular_Avg(ROI) PDAF_shading_R(ROI) = Right_Avg(ROI) /Regular_Avg(ROI) Update PDAF shading calibration for this ROI with abovecalculated values, and increment the counter associated with this ROI.Once enough frames have contributed in the calibration, and potentialoutliers rejected, this ROI can be marked as “calibrated”, after whichalready_calibrated( ) will start returning “true” for this ROI. Once allROIs are in “calibrated” state, PDAF_shading_calibration_ready( ) willstart returning “true”. } } } } valid_for_shading_calibration(ROI) { TheROI needs to be (a) flat enough and (b) bright enough. Both can bechecked from the filter response grid (AF-grid) and low resolutionrepresentation of the image (RGBS-grid), both of which are part oftypical 3A statistics }

FIG. 12 is an illustrative diagram of an example system 1200 forproviding self-calibration autofocus, arranged in accordance with atleast some implementations of the present disclosure. In variousimplementations, the example image processing system 1200 may have animaging device 1202 to form or receive captured image data. This can beimplemented in various ways. Thus, in one form, the image processingsystem 1200 may be a digital camera or other image capture device, andimaging device 1202, in this case, may be the camera hardware and camerasensor software, module, or component 1206. In other examples, imagingprocessing system 1200 may have an imaging device 1202 that includes ormay be a camera, and logic modules 1204 may communicate remotely with,or otherwise may be communicatively coupled to, the imaging device 1202for further processing of the image data.

This technology may include a camera such as a digital camera system, adedicated camera device, or an imaging phone or tablet, whether a stillpicture or video camera, or device with a preview screen, or somecombination of these. Thus, in one form, imaging device 1202 may includecamera hardware and optics including one or more sensors as describedabove as well as auto-focus as described above, zoom, aperture,ND-filter, auto-exposure, flash, and actuator controls. The sensors mayprovide PDAF sensor pixels in either a PDAF-MS system or a PDAF-PDsystem. The sensor controls may be part of a sensor module or component1206 for operating the sensor. The controls of the sensor component 1206may be part of the imaging device 1202, or may be part of the logicalmodules 1204 or both. Such sensor component can be used to generateimages for a viewfinder, which may include a preview screen, and takestill pictures or video. The imaging device 1202 also may have a lens,an image sensor with a RGB Bayer color filter, an analog amplifier, anA/D converter, other components to convert incident light into a digitalsignal, the like, and/or combinations thereof. The digital signal alsomay be referred to as the raw image data herein.

Other forms include a camera sensor-type imaging device or the like (forexample, a webcam or webcam sensor or other complementarymetal-oxide-semiconductor-type image sensor (CMOS)), without the use ofa red-green-blue (RGB) depth camera and/or microphone-array to locatewho is speaking. The camera sensor may also support other types ofelectronic shutters, such as global shutter in addition to, or insteadof, rolling shutter, and many other shutter types. In other examples, anRGB-Depth camera and/or microphone-array might be used in addition to orin the alternative to a camera sensor. In some examples, imaging device1202 may be provided with an eye tracking camera.

The imaging device 1202 also may have a lens actuator 1208 that has alens and a lens driver or driver logic that receives commands to movethe lens and applies an electrical current to move the lens. Anautofocus (AF) control 1210 may be provided on the imaging device 1202as well to collect calibration data from sensors and the lens actuator,and to transmit the data to memories 1204 and/or the AF component 1212.

In the illustrated example, the logic modules 1204 may include an AFcomponent that has a PDAF unit 1214. The PDAF unit has a PDAFcalibration unit 1216 and a run-time unit 1218. The PDAF calibrationunit 1216 has a phase shift to lens offset conversion unit 1220 whichhas a conversion convergence unit 1222. The PDAF calibration unit 1216also may have a shading unit 1224 with a shading calculation unit 1226and a calibration setting and tracking unit 1228. The run-time unit 1218may have a reliability unit 1221 and an AF unit that operates manydifferent AF techniques including PDAF and contrast. The operation ofthese components are described above, and corresponding components tothese components, such as in system 700, are clear from the context andnames of these components.

The components of logic modules 1204 including the lens PDAF calibrationunit 1216 may be operated by, or even entirely or partially located at,processor(s) 1230, and which may include an ISP and/or GPU 1232. Thelogic modules 1204 may be communicatively coupled to the components ofthe imaging device 1202 in order to receive raw image data. Optionally,data may be provided by a data stream separate from the raw image datastream. In these cases, it is assumed the logic modules 1204 areconsidered to be separate from the imaging device. This need not be so,and the logic modules very well may be considered to be part of theimaging device as well.

System 1200 may include one or more processors 1230 and memory stores1234. In the example of system 1200, memory stores 1234 may store imagecontent such as captured images (or image frames) (e.g., images or phaseautofocus images), golden module (or sample) data 1236, adjusted PDAFcalibration phase shift conversions and shading data 1246, and/or imagerelated data such as image data generated via an imaging pipeline and/orsystem or modules such as measurements and weights, focus phase shifts,reliability values, accumulated phase differences, region of interestdata, fitted curve data, signal-to-noise ratio data, or other data asdiscussed herein.

Graphics processing unit 1232 may include any number and type ofgraphics processing units that may provide the operations as discussedherein. Such operations may be implemented via software or hardware or acombination thereof. For example, graphics processing unit 1232 mayinclude circuitry dedicated to manipulate images obtained from memorystores 1234. Processor(s) 1230 may include any number and type ofprocessing units or modules that may provide control and other highlevel functions for system 1200 and/or provide any operations asdiscussed herein. Memory stores 1234 may be any type of memory such asvolatile memory (e.g., Static Random Access Memory (SRAM), DynamicRandom Access Memory (DRAM), etc.) or non-volatile memory (e.g., flashmemory, etc.), and so forth. In a non-limiting example, memory stores1234 may be implemented by cache memory. Otherwise, memory 234 may be anEEPROM or device file system. By one form, one or more units of imageprocessing system 1200 and autofocus component 1212 may be implementedvia an execution unit (EU) of graphics processing unit 1234. The EU mayinclude, for example, programmable logic or circuitry such as a logiccore or cores that may provide a wide array of programmable logicfunctions. In one form, any of these units may be implemented viadedicated hardware such as fixed function circuitry or the like. Fixedfunction circuitry may include dedicated logic or circuitry and mayprovide a set of fixed function entry points that may map to thededicated logic for a fixed purpose or function.

Various components of the systems described herein may be implemented insoftware, firmware, and/or hardware and/or any combination thereof. Forexample, various components of imaging device or system 100, 700, 1200,1300, or 1400 may be provided, at least in part, by hardware of acomputing System-on-a-Chip (SoC) such as may be found in a computingsystem such as, for example, a smart phone. Those skilled in the art mayrecognize that systems described herein may include additionalcomponents that have not been depicted in the corresponding figures. Forexample, the systems discussed herein may include additional componentssuch as bit stream multiplexer or de-multiplexer modules and the likethat have not been depicted in the interest of clarity.

While implementation of the example processes discussed herein mayinclude the undertaking of all operations shown in the orderillustrated, the present disclosure is not limited in this regard and,in various examples, implementation of the example processes herein mayinclude only a subset of the operations shown, operations performed in adifferent order than illustrated, or additional operations.

In addition, any one or more of the operations discussed herein may beundertaken in response to instructions provided by one or more computerprogram products. Such program products may include signal bearing mediaproviding instructions that, when executed by, for example, a processor,may provide the functionality described herein. The computer programproducts may be provided in any form of one or more machine-readablemedia. Thus, for example, a processor including one or more graphicsprocessing unit(s) or processor core(s) may undertake one or more of theoperations of the example processes herein in response to program codeand/or instructions or instruction sets conveyed to the processor by oneor more machine-readable media. In general, a machine-readable mediummay convey software in the form of program code and/or instructions orinstruction sets that may cause any of the devices and/or systemsdescribed herein to implement at least portions of imaging device orsystem 100, 700, 1200, 1300, or 1400, or any other module or componentas discussed herein.

As used in any implementation described herein, the term “module” refersto any combination of software logic, firmware logic, hardware logic,and/or circuitry configured to provide the functionality describedherein. The software may be embodied as a software package, code and/orinstruction set or instructions, and “hardware”, as used in anyimplementation described herein, may include, for example, singly or inany combination, hardwired circuitry, programmable circuitry, statemachine circuitry, fixed function circuitry, execution unit circuitry,and/or firmware that stores instructions executed by programmablecircuitry. The modules may, collectively or individually, be embodied ascircuitry that forms part of a larger system, for example, an integratedcircuit (IC), system on-chip (SoC), and so forth.

As used in any implementation described herein, the term “logic unit”refers to any combination of firmware logic and/or hardware logicconfigured to provide the functionality described herein. The logicunits may, collectively or individually, be embodied as circuitry thatforms part of a larger system, for example, an integrated circuit (IC),system on-chip (SoC), and so forth. For example, a logic unit may beembodied in logic circuitry for the implementation firmware or hardwareof the coding systems discussed herein. One of ordinary skill in the artwill appreciate that operations performed by hardware and/or firmwaremay alternatively be implemented via software, which may be embodied asa software package, code and/or instruction set or instructions, andalso appreciate that logic unit may also utilize a portion of softwareto implement its functionality.

As used in any implementation described herein, the term “component” mayrefer to a module or to a logic unit, as these terms are describedabove. Accordingly, the term “component” may refer to any combination ofsoftware logic, firmware logic, and/or hardware logic configured toprovide the functionality described herein. For example, one of ordinaryskill in the art will appreciate that operations performed by hardwareand/or firmware may alternatively be implemented via a software module,which may be embodied as a software package, code and/or instructionset, and also appreciate that a logic unit may also utilize a portion ofsoftware to implement its functionality.

FIG. 13 is an illustrative diagram of an example system 1300, arrangedin accordance with at least some implementations of the presentdisclosure. In various implementations, system 1300 may be a mediasystem although system 1300 is not limited to this context. For example,system 1300 may be incorporated into a personal computer (PC), laptopcomputer, ultra-laptop computer, tablet, touch pad, portable computer,handheld computer, palmtop computer, personal digital assistant (PDA),cellular telephone, combination cellular telephone/PDA, television,smart device (e.g., smart phone, smart tablet or smart television),mobile internet device (MID), messaging device, data communicationdevice, cameras (e.g. point-and-shoot cameras, super-zoom cameras,digital single-lens reflex (DSLR) cameras), and so forth.

In various implementations, system 1300 includes a platform 1302 coupledto a display 1320. Platform 1302 may receive content from a contentdevice such as content services device(s) 1330 or content deliverydevice(s) 1340 or other similar content sources. A navigation controller1350 including one or more navigation features may be used to interactwith, for example, platform 1302 and/or display 1320. Each of thesecomponents is described in greater detail below.

In various implementations, platform 1302 may include any combination ofa chipset 1305, processor 1310, memory 1312, antenna 1313, storage 1314,graphics subsystem 1315, applications 1316 and/or radio 1318. Chipset1305 may provide intercommunication among processor 1310, memory 1312,storage 1314, graphics subsystem 1315, applications 1316 and/or radio1318. For example, chipset 1305 may include a storage adapter (notdepicted) capable of providing intercommunication with storage 1314.

Processor 1310 may be implemented as a Complex Instruction Set Computer(CISC) or Reduced Instruction Set Computer (RISC) processors, x86instruction set compatible processors, multi-core, or any othermicroprocessor or central processing unit (CPU). In variousimplementations, processor 1310 may be dual-core processor(s), dual-coremobile processor(s), and so forth.

Memory 1312 may be implemented as a volatile memory device such as, butnot limited to, a Random Access Memory (RAM), Dynamic Random AccessMemory (DRAM), or Static RAM (SRAM).

Storage 1314 may be implemented as a non-volatile storage device suchas, but not limited to, a magnetic disk drive, optical disk drive, tapedrive, an internal storage device, an attached storage device, flashmemory, battery backed-up SDRAM (synchronous DRAM), and/or a networkaccessible storage device. In various implementations, storage 1314 mayinclude technology to increase the storage performance enhancedprotection for valuable digital media when multiple hard drives areincluded, for example.

Graphics subsystem 1315 may perform processing of images such as stillor video for display. Graphics subsystem 1315 may be a graphicsprocessing unit (GPU) or a visual processing unit (VPU), for example. Ananalog or digital interface may be used to communicatively couplegraphics subsystem 1315 and display 1320. For example, the interface maybe any of a High-Definition Multimedia Interface, DisplayPort, wirelessHDMI, and/or wireless HD compliant techniques. Graphics subsystem 1315may be integrated into processor 1310 or chipset 1305. In someimplementations, graphics subsystem 1315 may be a stand-alone devicecommunicatively coupled to chipset 1305.

The graphics and/or video processing techniques described herein may beimplemented in various hardware architectures. For example, graphicsand/or video functionality may be integrated within a chipset.Alternatively, a discrete graphics and/or video processor may be used.As still another implementation, the graphics and/or video functions maybe provided by a general purpose processor, including a multi-coreprocessor. In further embodiments, the functions may be implemented in aconsumer electronics device.

Radio 1318 may include one or more radios capable of transmitting andreceiving signals using various suitable wireless communicationstechniques. Such techniques may involve communications across one ormore wireless networks. Example wireless networks include (but are notlimited to) wireless local area networks (WLANs), wireless personal areanetworks (WPANs), wireless metropolitan area network (WMANs), cellularnetworks, and satellite networks. In communicating across such networks,radio 1318 may operate in accordance with one or more applicablestandards in any version.

In various implementations, display 1320 may include any television typemonitor or display. Display 1320 may include, for example, a computerdisplay screen, touch screen display, video monitor, television-likedevice, and/or a television. Display 1320 may be digital and/or analog.In various implementations, display 1320 may be a holographic display.Also, display 1320 may be a transparent surface that may receive avisual projection. Such projections may convey various forms ofinformation, images, and/or objects. For example, such projections maybe a visual overlay for a mobile augmented reality (MAR) application.Under the control of one or more software applications 1316, platform1302 may display user interface 1322 on display 1320.

In various implementations, content services device(s) 1330 may behosted by any national, international and/or independent service andthus accessible to platform 1302 via the Internet, for example. Contentservices device(s) 1330 may be coupled to platform 1302 and/or todisplay 1320. Platform 1302 and/or content services device(s) 1330 maybe coupled to a network 1360 to communicate (e.g., send and/or receive)media information to and from network 1360. Content delivery device(s)1340 also may be coupled to platform 1302 and/or to display 1320.

In various implementations, content services device(s) 1330 may includea cable television box, personal computer, network, telephone, Internetenabled devices or appliance capable of delivering digital informationand/or content, and any other similar device capable ofuni-directionally or bi-directionally communicating content betweencontent providers and platform 1302 and/display 1320, via network 1360or directly. It will be appreciated that the content may be communicateduni-directionally and/or bi-directionally to and from any one of thecomponents in system 1300 and a content provider via network 1360.Examples of content may include any media information including, forexample, video, music, medical and gaming information, and so forth.

Content services device(s) 1330 may receive content such as cabletelevision programming including media information, digital information,and/or other content. Examples of content providers may include anycable or satellite television or radio or Internet content providers.The provided examples are not meant to limit implementations inaccordance with the present disclosure in any way.

In various implementations, platform 1302 may receive control signalsfrom navigation controller 1350 having one or more navigation features.The navigation features of controller 1350 may be used to interact withuser interface 1322, for example. In various embodiments, navigationcontroller 1350 may be a pointing device that may be a computer hardwarecomponent (specifically, a human interface device) that allows a user toinput spatial (e.g., continuous and multi-dimensional) data into acomputer. Many systems such as graphical user interfaces (GUI), andtelevisions and monitors allow the user to control and provide data tothe computer or television using physical gestures.

Movements of the navigation features of controller 1350 may bereplicated on a display (e.g., display 1320) by movements of a pointer,cursor, focus ring, or other visual indicators displayed on the display.For example, under the control of software applications 1316, thenavigation features located on navigation controller 1350 may be mappedto virtual navigation features displayed on user interface 1322, forexample. In various embodiments, controller 1350 may not be a separatecomponent but may be integrated into platform 1302 and/or display 1320.The present disclosure, however, is not limited to the elements or inthe context shown or described herein.

In various implementations, drivers (not shown) may include technologyto enable users to instantly turn on and off platform 1302 like atelevision with the touch of a button after initial boot-up, whenenabled, for example. Program logic may allow platform 1302 to streamcontent to media adaptors or other content services device(s) 1330 orcontent delivery device(s) 1340 even when the platform is turned “off.”In addition, chipset 1305 may include hardware and/or software supportfor 5.1 surround sound audio and/or high definition 7.1 surround soundaudio, for example. Drivers may include a graphics driver for integratedgraphics platforms. In various embodiments, the graphics driver maycomprise a peripheral component interconnect (PCI) Express graphicscard.

In various implementations, any one or more of the components shown insystem 1300 may be integrated. For example, platform 1302 and contentservices device(s) 1330 may be integrated, or platform 1302 and contentdelivery device(s) 1340 may be integrated, or platform 1302, contentservices device(s) 1330, and content delivery device(s) 1340 may beintegrated, for example. In various embodiments, platform 1302 anddisplay 1320 may be an integrated unit. Display 1320 and content servicedevice(s) 1330 may be integrated, or display 1320 and content deliverydevice(s) 1340 may be integrated, for example. These examples are notmeant to limit the present disclosure.

In various embodiments, system 1300 may be implemented as a wirelesssystem, a wired system, or a combination of both. When implemented as awireless system, system 1300 may include components and interfacessuitable for communicating over a wireless shared media, such as one ormore antennas, transmitters, receivers, transceivers, amplifiers,filters, control logic, and so forth. An example of wireless sharedmedia may include portions of a wireless spectrum, such as the RFspectrum and so forth. When implemented as a wired system, system 1300may include components and interfaces suitable for communicating overwired communications media, such as input/output (I/O) adapters,physical connectors to connect the I/O adapter with a correspondingwired communications medium, a network interface card (NIC), disccontroller, video controller, audio controller, and the like. Examplesof wired communications media may include a wire, cable, metal leads,printed circuit board (PCB), backplane, switch fabric, semiconductormaterial, twisted-pair wire, co-axial cable, fiber optics, and so forth.

Platform 1302 may establish one or more logical or physical channels tocommunicate information. The information may include media informationand control information. Media information may refer to any datarepresenting content meant for a user. Examples of content may include,for example, data from a voice conversation, videoconference, streamingvideo, electronic mail (“email”) message, voice mail message,alphanumeric symbols, graphics, image, video, text and so forth. Datafrom a voice conversation may be, for example, speech information,silence periods, background noise, comfort noise, tones and so forth.Control information may refer to any data representing commands,instructions or control words meant for an automated system. Forexample, control information may be used to route media informationthrough a system, or instruct a node to process the media information ina predetermined manner. The implementations, however, are not limited tothe elements or in the context shown or described in FIG. 13.

As described above, system 1300 may be embodied in varying physicalstyles or form factors. FIG. 14 illustrates implementations of a smallform factor device 1400 in which system 1200 may be embodied. In variousembodiments, for example, device 1400 may be implemented as a mobilecomputing device a having wireless capabilities. A mobile computingdevice may refer to any device having a processing system and a mobilepower source or supply, such as one or more batteries, for example.

As described above, examples of a mobile computing device may include apersonal computer (PC), laptop computer, ultra-laptop computer, tablet,touch pad, portable computer, handheld computer, palmtop computer,personal digital assistant (PDA), cellular telephone, combinationcellular telephone/PDA, television, smart device (e.g., smartphone,smart tablet or smart television) with one or more autofocus cameras,mobile internet device (MID), messaging device, data communicationdevice, cameras (e.g. point-and-shoot cameras, super-zoom cameras,digital single-lens reflex (DSLR) cameras), and so forth.

Examples of a mobile computing device also may include computers thatare arranged to be worn by a person, such as a wrist computer, fingercomputer, ring computer, eyeglass computer, belt-clip computer, arm-bandcomputer, shoe computers, clothing computers, and other wearablecomputers. In various implementations, for example, a mobile computingdevice may be implemented as a smart phone capable of executing computerapplications, as well as voice communications and/or datacommunications. Although some embodiments may be described with a mobilecomputing device implemented as a smart phone by way of example, it maybe appreciated that other embodiments may be implemented using otherwireless mobile computing devices as well. The implementations are notlimited in this context.

As shown in FIG. 14, device 1400 may include a housing 1402, a display1404 including a screen 1410, an input/output (I/O) device 1406, and anantenna 1408. Device 1400 also may include navigation features 1412.Display 1404 may include any suitable display unit for displayinginformation appropriate for a mobile computing device. I/O device 1406may include any suitable I/O device for entering information into amobile computing device. Examples for I/O device 1406 may include analphanumeric keyboard, a numeric keypad, a touch pad, input keys,buttons, switches, rocker switches, microphones, speakers, voicerecognition device and software, and so forth. Information also may beentered into device 1400 by way of microphone (not shown). Suchinformation may be digitized by a voice recognition device (not shown).The implementations are not limited in this context.

Various forms of the devices and processes described herein may beimplemented using hardware elements, software elements, or a combinationof both. Examples of hardware elements may include processors,microprocessors, circuits, circuit elements (e.g., transistors,resistors, capacitors, inductors, and so forth), integrated circuits,application specific integrated circuits (ASIC), programmable logicdevices (PLD), digital signal processors (DSP), field programmable gatearray (FPGA), logic gates, registers, semiconductor device, chips,microchips, chip sets, and so forth. Examples of software may includesoftware components, programs, applications, computer programs,application programs, system programs, machine programs, operatingsystem software, middleware, firmware, software modules, routines,subroutines, functions, methods, procedures, software interfaces,application program interfaces (API), instruction sets, computing code,computer code, code segments, computer code segments, words, values,symbols, or any combination thereof. Determining whether animplementation is implemented using hardware elements and/or softwareelements may vary in accordance with any number of factors, such asdesired computational rate, power levels, heat tolerances, processingcycle budget, input data rates, output data rates, memory resources,data bus speeds and other design or performance constraints.

One or more aspects of at least one implementation may be implemented byrepresentative instructions stored on a machine-readable medium whichrepresents various logic within the processor, which when read by amachine causes the machine to fabricate logic to perform the techniquesdescribed herein. Such representations, known as “IP cores” may bestored on a tangible, machine readable medium and supplied to variouscustomers or manufacturing facilities to load into the fabricationmachines that actually make the logic or processor.

While certain features set forth herein have been described withreference to various implementations, this description is not intendedto be construed in a limiting sense. Hence, various modifications of theimplementations described herein, as well as other implementations,which are apparent to persons skilled in the art to which the presentdisclosure pertains are deemed to lie within the spirit and scope of thepresent disclosure.

The following examples pertain to further implementations.

A computer-implemented method of autofocus self-calibration comprisesreceiving, at an imaging device, initial phase detection autofocus(PDAF) calibration data with the same values to be provided to multipleimaging devices; capturing, by the imaging device, a plurality ofimages; generating, by the imaging device, device-specific PDAFcalibration data comprising refining PDAF calibration data by using theplurality of images; and providing the device-specific PDAF calibrationdata to be used to obtain, by the imaging device, image data of multiplesubsequent images.

By another implementation, the method may include that wherein theinitial and device-specific PDAF calibration data comprises or is basedon at least one conversion factor used to convert phase shifts to lensoffsets; wherein the imaging device has a sensor having a plurality ofsensor pixels providing image data divided into regions of interest, andthe method comprising generating a conversion factor for each region ofinterest; wherein generating device-specific PDAF calibration datacomprises using a phase shift of individual regions of interest (ROIs),wherein each ROI having a plurality of sensor pixels comprising at leastone PDAF sensor pixel pair forming a phase difference contributing togenerating the phase shift of the ROI; the method comprising using areliability value of individual ROIs to determine whether or not an ROIis to be used to generate the device-specific PDAF calibration data; andwherein the reliability value is based on analysis of a curve formed ofcandidate phase shift values and accumulated phase differences of thePDAF sensor pixel pairs of the individual ROIs; wherein generatingdevice-specific PDAF calibration data comprises determining whether ornot to use an ROI to generate the device-specific PDAF calibration datacomprising determining if the image data of an ROI of a current image issufficiently unchanged from the image data of the same ROI on a lastimage used to generate PDAF calibration data.

The generating of device-specific PDAF calibration data may becomprising: performing multiple autofocus iterations comprising moving alens of the image capture device to an iteration lens position forindividual iterations; determining a focus lens position on one of theiterations of the multiple autofocus iterations; determining aniteration focus lens offset for the individual iterations and thatindicates the lens offset from the iteration lens position to the focuslens position; and using an iteration phase shift established as aresult of the iteration lens position and the iteration focus lensoffset to generate a phase shift to lens offset conversion factor and ofeach of the individual iterations prior to the iteration establishingthe focus lens offset; replacing or adjusting the initial PDAFcalibration data with the conversion factor or PDAF sample-specificcalibration data based on the conversion factor when the conversionfactor is sufficiently similar or the same on multiple ones of theindividual iterations, and the conversion factor is obtained at each ofa predetermined number of rounds each round having an iterationestablishing the focus lens position and having a plurality of theindividual iterations; and providing a conversion factor of each regionof interest (ROI) of a sensor of the imaging device, wherein the sensoris formed of groups of sensor pixels each forming one of the ROIs;wherein contrast autofocus is performed during at least some of theindividual iterations to obtain the focus lens position; wherein thePDAF sample-specific calibration data is a look-up table of phase shiftsand corresponding lens offsets based on the conversion factor; whereinthe generating of the sample-specific PDAF calibration adjustment datais performed at at least one of: only once starting at the beginning ofa first use of the imaging device by an end-user, and each time theimaging device is turned on; and wherein the PDAF calibration datacomprises a set of left and right shading values formed, at least inpart, from pairs of PDAF sensor pixels of a sensor of the imagingdevice.

By yet another implementation, a computer-implemented system forself-calibration for phase detection autofocus, comprising: at least onememory to store image data from pairs of phase detection autofocus(PDAF) sensor pixels of a sensor on an imaging device and other PDAFcalibration data; at least one processing unit coupled to the memory;and a phase detection autofocus unit to operate by: receiving, at animaging device, initial phase detection autofocus (PDAF) calibrationdata with the same values to be provided to multiple imaging devices;capturing, by the imaging device, a plurality of images; generating, bythe imaging device, device-specific PDAF calibration data comprisingiteratively refining PDAF calibration data by using the plurality ofimages; and providing the device-specific PDAF calibration data to beused to obtain, by the imaging device, image data of multiple subsequentimages.

By another example, the system includes wherein the imaging devicecomprises at least one sensor comprising a plurality of pairs of PDAFsensor pixels or pixel sides of divided single sensor pixels, andwherein the PDAF calibration data comprises shading statistics formed ofa set of first PDAF shading values and a set of second PDAF shadingvalues, each set being from a different one of the two of individualpairs of the PDAF sensor pixels or pixel sides; wherein the shadingvalues are sufficiently calibrated when a predetermined sufficientnumber of shading values contribute to generate a final combined shadingvalue over iterations wherein each iteration being associated with oneof the plurality of the images and one of the shading values; whereinthe at least one sensor comprises a plurality of sensor pixels groupedinto regions of interest (ROIs) with at least one pair of PDAF sensorpixels or pixel sides being disposed in individual regions of interest,and wherein the phase detection autofocus unit operates by generating afinal combined shading value for individual ROIs; wherein generatingdevice-specific PDAF calibration data is complete when each ROI of thesensor has a final combined shading value; wherein individual finalcombined shading values are each associated with an average shadingvalue of the shading values in individual ROI and shading values of oneof the first and second sets of the PDAF shading values; wherein thefinal combined shading value of one of the ROIs is an average of anaverage ROI shading value of a current iteration and average ROI shadingvalue of prior iterations of the same ROI; wherein the final combinedshading value is an average of the shading values associated with an ROIand of one of the first or second sets of PDAF shading values divided bythe average shading value of sensor pixels in the same ROI includingnon-PDAF sensor pixels if present; and wherein only those ROIs that aredeemed valid are included in the computation to determine a finalcombined shading value of an ROI, and comprising at least one of: a testto determine if an ROI is sufficiently bright, a test to determine if anROI has sufficiently flat color, and both.

By one approach, at least one computer readable article comprises aplurality of instructions that in response to being executed on acomputing device, cause the computing device to operate by: receiving,at an imaging device, initial phase detection autofocus (PDAF)calibration data with the same values to be provided to multiple imagingdevices; capturing, by the imaging device, a plurality of images;generating, by the imaging device, device-specific PDAF calibration datacomprising iteratively refining PDAF calibration data by using theplurality of images; and providing the device-specific PDAF calibrationdata to be used to obtain, by the imaging device, image data of multiplesubsequent images.

By another approach, the instructions include that wherein the imagingdevice comprises at least one sensor comprising a plurality of PDAFsensor pixels arranged into regions of interest (ROIs), and wherein theinitial and device-specific PDAF calibration data comprises shadingstatistics for each ROI and formed of a set of first PDAF shading valuesand a set of second PDAF shading values, each set being from a differentone of pairs of the PDAF sensor pixels or sides of divided single sensorpixels, wherein the shading statistics comprises a shading value formedby dividing the average of one of the sets of shading values in an ROIby the average shading value of all sensor pixels in the ROI includingthe non-PDAF sensor pixels and of the same color; and wherein theinitial and device-specific PDAF calibration data comprises at least oneconversion factor used to convert phase shifts to lens offsets, and foreach ROI.

In a further example, at least one machine readable medium may include aplurality of instructions that in response to being executed on acomputing device, causes the computing device to perform the methodaccording to any one of the above examples.

In a still further example, an apparatus may include means forperforming the methods according to any one of the above examples.

The above examples may include specific combination of features.However, the above examples are not limited in this regard and, invarious implementations, the above examples may include undertaking onlya subset of such features, undertaking a different order of suchfeatures, undertaking a different combination of such features, and/orundertaking additional features than those features explicitly listed.For example, all features described with respect to any example methodsherein may be implemented with respect to any example apparatus, examplesystems, and/or example articles, and vice versa.

1. A computer-implemented method of autofocus self-calibrationcomprising: receiving, at an imaging device, initial phase detectionautofocus (PDAF) calibration data with the same values to be provided tomultiple imaging devices; capturing, by the imaging device, a pluralityof images; generating, by the imaging device, device-specific PDAFcalibration data comprising refining PDAF calibration data by using theplurality of images; and providing the device-specific PDAF calibrationdata to be used to obtain, by the imaging device, image data of multiplesubsequent images.
 2. The method of claim 1 wherein the initial anddevice-specific PDAF calibration data comprises or is based on at leastone conversion factor used to convert phase shifts to lens offsets. 3.The method of claim 2 wherein the imaging device has a sensor having aplurality of sensor pixels providing image data divided into regions ofinterest, and the method comprising generating a conversion factor foreach region of interest.
 4. The method of claim 1 wherein generatingdevice-specific PDAF calibration data comprises using a phase shift ofindividual regions of interest (ROIs), wherein each ROI having aplurality of sensor pixels comprising at least one PDAF sensor pixelpair forming a phase difference contributing to generating the phaseshift of the ROI.
 5. The method of claim 4 comprising using areliability value of individual ROIs to determine whether or not an ROIis to be used to generate the device-specific PDAF calibration data. 6.The method of claim 5 wherein the reliability value is based on analysisof a curve formed of candidate phase shift values and accumulated phasedifferences of the PDAF sensor pixel pairs of the individual ROIs. 7.The method of claim 1 wherein generating device-specific PDAFcalibration data comprises determining whether or not to use an ROI togenerate the device-specific PDAF calibration data comprisingdetermining if the image data of an ROI of a current image issufficiently unchanged from the image data of the same ROI on a lastimage used to generate PDAF calibration data.
 8. The method of claim 1wherein generating device-specific PDAF calibration data comprising:performing multiple autofocus iterations comprising moving a lens of theimage capture device to an iteration lens position for individualiterations; determining a focus lens position on one of the iterationsof the multiple autofocus iterations; determining an iteration focuslens offset for the individual iterations and that indicates the lensoffset from the iteration lens position to the focus lens position; andusing an iteration phase shift established as a result of the iterationlens position and the iteration focus lens offset to generate a phaseshift to lens offset conversion factor and of each of the individualiterations prior to the iteration establishing the focus lens offset. 9.The method of claim 8 comprising replacing or adjusting the initial PDAFcalibration data with the conversion factor or PDAF sample-specificcalibration data based on the conversion factor when the conversionfactor is sufficiently similar or the same on multiple ones of theindividual iterations, and the conversion factor is obtained at each ofa predetermined number of rounds each round having an iterationestablishing the focus lens position and having a plurality of theindividual iterations.
 10. The method of claim 9 comprising providing aconversion factor of each region of interest (ROI) of a sensor of theimaging device, wherein the sensor is formed of groups of sensor pixelseach forming one of the ROIs.
 11. The method of claim 8 wherein contrastautofocus is performed during at least some of the individual iterationsto obtain the focus lens position.
 12. The method of claim 8 wherein thePDAF sample-specific calibration data is a look-up table of phase shiftsand corresponding lens offsets based on the conversion factor.
 13. Themethod of claim 1 wherein the generating of the sample-specific PDAFcalibration adjustment data is performed at at least one of: only oncestarting at the beginning of a first use of the imaging device by anend-user, and each time the imaging device is turned on.
 14. The methodof claim 1 wherein the PDAF calibration data comprises a set of left andright shading values formed, at least in part, from pairs of PDAF sensorpixels of a sensor of the imaging device.
 15. A system forself-calibration for phase detection autofocus, comprising: at least onememory to store image data from pairs of phase detection autofocus(PDAF) sensor pixels of a sensor on an imaging device and other PDAFcalibration data; at least one processing unit coupled to the memory;and a phase detection autofocus unit to operate by: receiving, at animaging device, initial phase detection autofocus (PDAF) calibrationdata with the same values to be provided to multiple imaging devices;capturing, by the imaging device, a plurality of images; generating, bythe imaging device, device-specific PDAF calibration data comprisingiteratively refining PDAF calibration data by using the plurality ofimages; and providing the device-specific PDAF calibration data to beused to obtain, by the imaging device, image data of multiple subsequentimages.
 16. The system of claim 15, wherein the imaging device comprisesat least one sensor comprising a plurality of pairs of PDAF sensorpixels or pixel sides of divided single sensor pixels, and wherein thePDAF calibration data comprises shading statistics formed of a set offirst PDAF shading values and a set of second PDAF shading values, eachset being from a different one of the two of individual pairs of thePDAF sensor pixels or pixel sides.
 17. The system of claim 16, whereinthe shading values are sufficiently calibrated when a predeterminedsufficient number of shading values contribute to generate a finalcombined shading value over iterations wherein each iteration beingassociated with one of the plurality of the images and one of theshading values.
 18. The system of claim 17, wherein the at least onesensor comprises a plurality of sensor pixels grouped into regions ofinterest (ROIs) with at least one pair of PDAF sensor pixels or pixelsides being disposed in individual regions of interest, and wherein thephase detection autofocus unit operates by generating a final combinedshading value for individual ROIs.
 19. The system of claim 18, whereingenerating device-specific PDAF calibration data is complete when eachROI of the sensor has a final combined shading value.
 20. The system ofclaim 18, wherein individual final combined shading values are eachassociated with an average shading value of the shading values inindividual ROI and shading values of one of the first and second sets ofthe PDAF shading values.
 21. The system of claim 20, wherein the finalcombined shading value of one of the ROIs is an average of an averageROI shading value of a current iteration and average ROI shading valueof prior iterations of the same ROI.
 22. The system of claim 18 whereinthe final combined shading value is an average of the shading valuesassociated with an ROI and of one of the first or second sets of PDAFshading values divided by the average shading value of sensor pixels inthe same ROI including non-PDAF sensor pixels if present.
 23. The systemof claim 18 wherein only those ROIs that are deemed valid are includedin the computation to determine a final combined shading value of anROI, and comprising at least one of: a test to determine if an ROI issufficiently bright, a test to determine if an ROI has sufficiently flatcolor, and both.
 24. At least one machine readable medium comprising aplurality of instructions that in response to being executed on animaging device, cause the imaging device to be operated by: receiving,at an imaging device, initial phase detection autofocus (PDAF)calibration data with the same values to be provided to multiple imagingdevices; capturing, by the imaging device, a plurality of images;generating, by the imaging device, device-specific PDAF calibration datacomprising iteratively refining PDAF calibration data by using theplurality of images; and providing the device-specific PDAF calibrationdata to be used to obtain, by the imaging device, image data of multiplesubsequent images.
 25. The machine readable medium of claim 24, whereinthe imaging device comprises at least one sensor comprising a pluralityof PDAF sensor pixels arranged into regions of interest (ROIs), andwherein the initial and device-specific PDAF calibration data comprisesshading statistics for each ROI and formed of a set of first PDAFshading values and a set of second PDAF shading values, each set beingfrom a different one of pairs of the PDAF sensor pixels or sides ofdivided single sensor pixels, wherein the shading statistics comprises ashading value formed by dividing the average of one of the sets ofshading values in an ROI by the average shading value of all sensorpixels in the ROI including the non-PDAF sensor pixels and of the samecolor; and wherein the initial and device-specific PDAF calibration datacomprises at least one conversion factor used to convert phase shifts tolens offsets, and for each ROI.